Class Fox::FXComboBox
In: rdoc-sources/FXComboBox.rb
lib/fox12/iterators.rb
Parent: FXPacker

Combobox

Events

The following messages are sent by FXComboBox to its target:

SEL_CHANGED:sent when the text in the text field changes; the message data is a String containing the new text.
SEL_COMMAND:sent when a new item is selected from the list, or when a command message is sent from the text field; the message data is a String containing the new text.

ComboBox styles

COMBOBOX_NO_REPLACE:Leave the list the same
COMBOBOX_REPLACE:Replace current item with typed text
COMBOBOX_INSERT_BEFORE:Typed text inserted before current
COMBOBOX_INSERT_AFTER:Typed text inserted after current
COMBOBOX_INSERT_FIRST:Typed text inserted at begin of list
COMBOBOX_INSERT_LAST:Typed text inserted at end of list
COMBOBOX_STATIC:Unchangable text box
COMBOBOX_NORMAL:Default options for comboboxes

Message identifiers

ID_LIST:identifier associated with the embedded FXList instance
ID_TEXT:identifier associated with the embedded FXTextField instance

Methods

Included Modules

Enumerable

Attributes

backColor  [RW]  Window background color [FXColor]
comboStyle  [RW]  Combo box style [Integer]
currentItem  [RW]  Index of current item, or -1 if no current item [Integer]
editable  [W]  Editable state [Boolean]
font  [RW]  Text font [FXFont]
helpText  [RW]  Status line help text [String]
numColumns  [RW]  Number of columns [Integer]
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]
text  [RW]  Text [String]
textColor  [RW]  Text color [FXColor]
tipText  [RW]  Tool tip message [String]

Public Class methods

Return an initialized FXComboBox instance.

Parameters:

p:the parent widget for this combo-box [FXComposite]
nc:number of columns [Integer]
tgt:message target [FXObject]
sel:message identifier [Integer]
opts:the options [Integer]
x:initial x-position [Integer]
y:initial y-position [Integer]
w:initial width [Integer]
h:initial height [Integer]
pl:left-side padding, in pixels [Integer]
pr:right-side padding, in pixels [Integer]
pt:top-side padding, in pixels [Integer]
pb:bottom-side padding, in pixels [Integer]

Public Instance methods

Append a new item to the list with the specified text and user data.

Remove all items from the list

Calls block once for each item in the list, passing the item’s text and user data as parameters.

Return true if combobox is editable

Get data pointer for the item at index. Raises IndexError if index is out of bounds.

Get text for the item at index. Raises IndexError if index is out of bounds.

Insert a new item at index, with the specified text and user data. Raises IndexError if index is out of bounds.

Return true if the item at index is the current item. 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.

Return true if the pane is shown.

Prepend an item to the list with the specified text and user data

Remove the item at index from the list. Raises IndexError if index is out of bounds.

Return the text of the item at the given index. Raises IndexError if index is out of bounds.

Replace the item at index with a new item with the specified text and user data. Raises IndexError if index is out of bounds.

Set user data for the item at index. Raises IndexError if index is out of bounds.

Set text for the item at index. Raises IndexError if index is out of bounds.

Sort items using current sort function

[Validate]