Class
Lcombobox
Home
In: locana/l_combobox.rb
Parent: Ltextbox

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:

Operation:

Methods

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=,
Public Class methods
listbox_is_active?() src

Returns true if the popup listbox of any combobox is open.

listbox_is_active() src

Returns the open popup listbox of a combobox. Returns nil if there is no open listbox.

close_listbox() src

Closes the open popup list box.

Public Instance methods
include_objects() src

Adds the button and creates several instance variables.

valid_attribute?(attribute, lvalue=nil) src

Adds support the :value, :text, and :otype attributes.

open(parent) src

Opens the button.

close() src

Closes the listbox and the button.

prepare(parent=nil, move_obj=nil) src

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.

pixel_width() src

Adds extra room for the button.

clientW() src

The client area excludes the width of the button.

allow_any_value?() src

Returns true is this combobox will allow any value including values not in the :text attribute.

font=(new_value) src

Forward this to the listbox.

state=(new_value) src

Forward this to the button.

text=(new_value) src
 Forward this to the listbox.  The :text attribute applies to the popup listbox.
value=(new_value) src

Sets the value in the popup listbox.

select(index) src

Selects or highlights the value at index.

move(x, y, w=nil, h=nil, remember_position=nil) src

Moves the button and resizes the listbox. The button is always to the right of the textbox.

on_enter_key(levent=nil, &block) src

The default is to move the focus to the next object.

on_escape_key(levent=nil, &block) src

Closes the listbox.

on_up_key(levent=nil, &block) src

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.

on_down_key(levent=nil, &block) src

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.

on_pageup_key(levent=nil, &block) src

Scroll up one page in the listbox only if the listbox is open.

on_pagedown_key(levent=nil, &block) src

Scroll down one page in the listbox only if the listbox is open.

on_change(levent=nil, &block) src

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).

on_exit(levent=nil, &block) src

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.

on_close_listbox(levent=nil, &block) src

Closes the popup list box for this combobox.

is_listbox_open?() src

Returns true if the listbox is open.

on_open_listbox(levent=nil, &block) src

Opens the popup list box. If the listbox is already open, this will close it.


Seva Software


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.

http://www.arunadb.org http://www.locana.org http://www.ruby-lang.org http://www.coolwell.org http://www.sevasoftware.com