Class | Fox::FXListBox |
In: |
rdoc-sources/FXListBox.rb
|
Parent: | FXPacker |
The List Box is a control to select one of a list of options. It looks similar to a Combo Box except that List Box yields integer numbers only. When an option is selected, List Box will send an SEL_COMMAND with the index of the opton. While manipulating the list, it may send SEL_CHANGED messages to indicate which option the cursor is hovering over. The List Box is able to receive ID_GETINTVALUE and ID_SETINTVALUE which will retrieve the current option or change the selected option.
The following messages are sent by FXListBox to its target:
SEL_COMMAND: | sent when a new list item is clicked; the message data is the index of the selected item. |
SEL_CHANGED: | sent when a new list item is clicked. |
LISTBOX_NORMAL: | Normal style |
ID_LIST ID_FIELD
<< | -> | appendItem |
backColor | [R] | Background color [FXColor] |
currentItem | [RW] | Current item‘s index, or -1 if no current item [Integer] |
font | [RW] | Text font [FXFont] |
helpText | [RW] | Status line help text [String] |
numItems | [R] | Number of items in the list [Integer] |
numVisible | [RW] | Number of visible items [Integer] |
selBackColor | [RW] | Background color for selected items [FXColor] |
selTextColor | [RW] | Text color for selected items [FXColor] |
textColor | [RW] | Text color [FXColor] |
tipText | [RW] | Tool tip message [String] |
Returns an initialized FXListBox instance.
Extract item from list and return a reference to the item. Raises IndexError if index is out of bounds.
Search items by text, beginning from item start. If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list. The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, passing SEARCH_PREFIX causes searching for a prefix of the item text. Return -1 if no matching item is found.
Search items by associated user data, beginning from item start. If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list.
Insert a new item at index. Raises IndexError if index is out of bounds.
Move item from oldIndex to newIndex and return the new index of the item. Raises IndexError if either oldIndex or newIndex is out of bounds.
Replace the item at index with a new item with the specified text, icon and data. Raises IndexError if index is out of bounds.