index    previous    next
 
listbox

LISTBOX

The LISTBOX control allows a list to be viewed and an item to be selected from it.

The user cannot directly change a value displayed in a LISTBOX control while it is being displayed. The system can change any of the values in a LISTBOX control while it is being displayed. If a value needs to be changed by the user, the programmer must provide a mechanism that will allow the list being displayed to be changed e.g. a TEXTBOX to enter the value and a BUTTON to apply the changed value to the LISTBOX.

The LISTBOX control has an associated action function which is invoked when a list item is selected (clicked on) by the user. The action function is invoked with the item ID (the items position withing the list with the first item being item 0, the second item being item 1 etc) and the column ID.

The programmer refers to the action function as the "click_func". To invoke a specific action function when the button is pressed by the user, the programmer sets the "click_func_name" in the "button control" dialog to the name of the function to be invoked. The "click_func" can be either an internal XPE interface function (e.g. WINCTL::dismiss_control), an external user written XPE function or an external user written C++ function located in a dynamic link library.

The LISTBOX control can take an explicit list of items or can access an abitary list via three specially available access methods (specific to each instance of a LISTBOX control). The explict list property is called "option_list" and is specified as an XPE array. The access methods are defined as properties of the LISTBOX control and these properties are called: get_opt_cnt_func_name, get_opt_func_name and is_opt_selected_func_name.

get_opt_cnt_func - return the number of items in the list
get_opt_func - return item N of the list
is_opt_selected_func - return true (not 0) if item N is currently selected, return false (0) otherwise
These functions can be either internal XPE interface functions (e.g. WINCTL::dismiss_control), external user written XPE functions or external user written C++ functions located in a dynamic link library.