|
ComboBox
ComboBox is a combination of a text field and drop-down list.
This example has a default value, two choices, and it is editable. <combobox text="ComboBox">
<choice text="Choice" icon="image.gif" />
<choice text="Disabled" enabled="false" />
</combobox>
Properties
| icon | icon | | The icon image that the combobox displays. |
| selected | integer | -1 | The index of the currently selected choice, value -1
indicates a custom edited value in an editable box. |
| text, columns, editable, and alignment parameters are described at
textfield |
| name, enabled, visible, tooltip, property, i18n, width, height, colspan, rowspan,
weightx, weighty, halign, and valign parameters are similar to
component |
Listeners
| action | Invokes the given method when there was change in the text or a new
choice was selected. |
Choice
The drop down list of a combobox contains choices.
The popup combolist internally handles scrolling.
Properties
| name | string | | Identifies the item. |
| enabled | boolean | true | Enables or disables the item. A disabled item is painted gray,
and can't be selected by mouse or keyboard. |
| text | string | | The text text that the choice displays. |
| icon | icon | | The icon image that the choice displays. |
| alignment | choice | left | The alignment of the text and image similar to label.
Possible values are: left, center, and right. |
| tooltip | string | | The text pops up when the mouse lingers inside this specified part of the component,
otherwise the tooltip text of the component. |
| font | font | | Custom font to use for text. |
| foreground | color | | Custom foreground (text) color. |
| background | color | | Custom background color. |
| property | property | | Adds an arbitrary key/value client property (or properties)
stored in a hashtable of the item. |
Keyboard-actions
| Spacebar, Down arrow | Post menu |
| Up arrow | Selects previous (or last) choice |
| Down arrow | Selects next (or first) choice |
| Home | Selects first choice |
| End | Selects last choice |
| Page Up | Selects choice one view up |
| Page Down | Selects choice one view down |
| Enter, Return, Spacebar | Activates selection, and retract menu |
| Escape | Retract menu without taking selection |
| Tab, Shift-Tab | Navigate forward, backward |
|