This class adds a combobox to a Lcontainer.
This allows you to type in a value or select a value from a drop down popup
listbox. This class is based on the Ltextbox
class and uses a Lcombobox_button (for
opening the popup lisbbox), and Lcombobox_listbox (the popup listbox
window). The popup listbox only appears when requested and lets the user
interactively selected an item from the list. The popup listbox can be
opened by clicking on the button with mouse or using the shift-down
arrow/shift-up arrow, ctrl-down arrow or ctrl-up arrow keys.
Here is a list of additional attributes supported only by the Lcombobox class:
- :otype - :allow_any_value allows you to type any value into the combobox
when true, when nil or false, you must enter a value that exists in the
popup listbox (:text attribute).
- :value - contains the selected item which is either an item from the
listbox (the :text attribute) or the text typed into the combobox when
:otype=>:allow_any_value.
- :text - an array of text for the popup listbox window.
Operation:
- Click on the button to the right to open the listbox and allow you to click
on an item to select it. If the listbox is already open, clicking on the
button will close the listbox.
- Press the down arrow to get the next item in the listbox without opening
the listbox.
- Press the up arrow to get the previous item in the listbox without opening
the listbox.
- Type characters until the desired item in the list is displayed. The first
item in the list matching the typed characters is displayed in the textbox.
- When typing a character causes the text to not match an item in the list,
the character is ignored and the display is beeped. You must pick an item
in the list.
- Press ctrl or shift up or down arrow to open the listbox. Press enter to
select an item and close the list box.
- Press ctrl or shift up or down arrow again to close the listbox.
allow_any_value?,
clientW,
close,
close_listbox,
font=,
include_objects,
is_listbox_open?,
listbox_is_active,
listbox_is_active?,
move,
on_change,
on_close_listbox,
on_down_key,
on_enter_key,
on_escape_key,
on_exit,
on_open_listbox,
on_pagedown_key,
on_pageup_key,
on_up_key,
open,
pixel_width,
prepare,
select,
state=,
text=,
valid_attribute?,
value=,
Returns true if the popup listbox of any combobox is open.
Returns the open popup listbox of a combobox. Returns nil if there is no
open listbox.
Closes the open popup list box.
Adds the button and creates several instance variables.
Adds support the :value, :text, and :otype attributes.
Closes the listbox and the button.
Sets the initial position in the popup listbox based on the :value
attribute and moves the button to the end of the textbox after the combobox
is prepared.
Adds extra room for the button.
The client area excludes the width of the button.
Returns true is this combobox will allow any value including values not in
the :text attribute.
Forward this to the listbox.
Forward this to the button.
Forward this to the listbox. The :text attribute applies to the popup listbox.
- new_value - any array of values for the combobox. Could be an array of
Strings or Symbols.
Sets the value in the popup listbox.
- new_value - either an item in the :text array (the popup listbox) or text
for the textbox.
Selects or highlights the value at index.
- index is an integer when :otype=>:single or an array of integers (an
array of selected values).
Moves the button and resizes the listbox. The button is always to the right
of the textbox.
The default is to move the focus to the next object.
Shift/ctrl up arrow opens and closes the list box. Up arrow will move the
listbox cursor to the previous item in the listbox and select it in the
textbox.
Shift/ctrl down arrow will open and close the list box. Down arrow will
move the listbox cursor to the next item and select it in the textbox.
Scroll up one page in the listbox only if the listbox is open.
Scroll down one page in the listbox only if the listbox is open.
This is raised when anything changes in the textbox. Also take actions when
the content of the textbox does not exist in the popup listbox (the :text
attribute).
Closes the listbox if it is opened. If the textbox contains any text that
does not match an item in the list, all text is cleared from the textbox.
Closes the popup list box for this combobox.
Returns true if the listbox is open.
Opens the popup list box. If the listbox is already open, this will close
it.
Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.