Most of the instance variables and methods of a combo box are described in the discussion of the XbpSLE and XbpListbox classes. This includes discussion of how keyboard and mouse events are processed. The only additional key combination that is processed by a combo box is Alt+Down Arrow. This is used to drop down the list box.
Class XbpCombobox() Foundation
Class function of the XbpCombobox class.
The XbpCombobox class provides the combo box dialog element. Combo boxes combine an entry field (XbpSLE) with a list box (XbpListBox). The list box makes a limited set of values available to the user. The value selected is entered into the entry field. The list box portion of the combo box can either be permanently displayed or can be dropped down to display available values in response to a mouse click. The user may also choose to input data in the entry field using the keyboard rather than picking from the list box. If a combo box is defined as READONLY, no characters can be entered in the entry field. In this case, the range of values is limited to the items in the list box.
Special characteristics with the combo box
During XbpCombobox object creation, care should be taken in assigning the height of the combo box with the <aSize> parameter. The height includes both the entry field and the list box, even when the list box is hidden and is only opened following a mouse click.
The height of the entry field of the combo box is automatically adjusted to the selected font. The height cannot be set by the user.
Accessing data with a combo box
For all Xbase Parts, the :getData() method retrieves the value (or values) of the edit buffer of the dialog element. Since the combo box is a combination of two dialog elements there are two possible values that can be retrieved. In the class hierarchy XbpListBox comes first. Thus, calling methods that exist in both classes are executed by the XbpListBox by default:
The method :getData() exists in the XbpSLE as well as the XbpListBox classes and the class XbpCombobox is derived from both of these classes. Because of this, the :getData() method of either part of the resulting combo box must be explicitly called using what is called a "cast". This is done by including the class name. In order to read the value of the entry field or the position of the marked value in the list box, the methods must be called as shown below:
Similar calls must be made for the :setData() method and all other methods with the same identifier in both the XbpSLE and XbpListBox class. The affected methods are those implemented in the DataRef class.
Data access via :dataLink code block
Since the XbpCombobox class inherits the :dataLink member variable from two super classes, the behavior of an XbpCombobox object depends on which :dataLink a data code block is assigned to. The methods :setData(), :getData(), :editbuffer() and :undo()evaluate the :dataLink code block in the same way as in the super classes. Data access via :dataLink code block is then accomplished like in the XbpSLE class or in the XbpListbox class.
Using a combo box as an entry field (XbpSLE)
An XbpCombobox object can be used as an entry field accessing memory or field variables:
Using a combo box as a selection list (XbpListbox)
The instance variables in this group configure system resources. If changes are made to the default values, they must either be made before the :create() method is executed or the :configure() method must be used to activate the changes.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.