AFXComboBox

This class contains a label that precedes a combo box, which allows the user to select entries from a drop-down list.


AFXComboBox(p, ncols, nvis, text, tgt=None, sel=0, opts=0, x=0, y=0, w=0, h=0, pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD)

Constructor.

ArgumentTypeDefaultDescription
pFXComposite Parent widget.
ncolsInt Number of columns in the combo box (use 0 for auto-sizing).
nvisInt Number of visible items in the combo box's drop down list.
textString Label string.
tgtFXObjectNoneMessage target.
selInt0Message ID.
optsInt0Options and hints.
xInt0X coordinate of origin.
yInt0Y coordinate of origin.
wInt0Width of the widget.
hInt0Height of the widget.
plIntDEFAULT_PADLeft padding (margin).
prIntDEFAULT_PADRight padding (margin).
ptIntDEFAULT_PADTop padding (margin).
pbIntDEFAULT_PADBottom padding (margin).


appendItem(text, sel=0)

Adds an item to the end of the list.

ArgumentTypeDefaultDescription
textString Text.
selInt0Selector.


clearItems()

Removes all items from the list.


create()

Creates the combo box.

Reimplemented from FXComposite.


disable()

Disables the combo box.

Reimplemented from FXWindow.


enable()

Enables the combo box.

Reimplemented from FXWindow.


getCheck()

Returns the state of the check button or the radio button.


getCurrentItem()

Returns the index of the current item.


getHelpText()

Returns the status line help text.


getItemData(index)

Returns the data for the specified item.

ArgumentTypeDefaultDescription
indexInt Index.


getItemIndexForData(data)

Returns the index of the first item with the associated data or -1 if not found.

ArgumentTypeDefaultDescription
data   


getItemIndexForFloat(val)

Returns the index of the first item with the text evaluating to the given value.

ArgumentTypeDefaultDescription
valFloat  


getItemProvider()

Returns the provider of the combo box's items.


getItemText(index)

Returns the text for the specified item.

ArgumentTypeDefaultDescription
indexInt Index.


getLabelFont()

Returns the label font.


getLabelText()

Returns the label string.


getNumColumns()

Returns the number of columns.


getNumItems()

Returns the number of items in the list.


getNumVisible()

Returns the number of visible items.


getText()

Returns the text displayed in input field.


getTipText()

Returns the tool tip message.


insertItem(index, text, sel=0)

Inserts a new item at the specified index position.

ArgumentTypeDefaultDescription
indexInt Index.
textString Text.
selInt0Selector.


isEditable()

Returns True if the text in the input field may be edited.


isItemCurrent(index)

Returns True if the item at the specified index position is the current item.

ArgumentTypeDefaultDescription
indexInt Index.


isReadOnlyState()

Returns True if the combo box appears in the read-only state.


removeItem(index)

Removes the item at the specified index position from the list.

ArgumentTypeDefaultDescription
indexInt Index.


replaceItem(index, text, sel=0)

Replaces the item at the specified index position.

ArgumentTypeDefaultDescription
indexInt Index.
textString Text.
selInt0Selector.


setCheck(state)

Sets the state of the check button or the radio button.

ArgumentTypeDefaultDescription
stateBool Button state.


setCheckButtonSelector(sel)

Sets the message ID of the check button or the radio button.

ArgumentTypeDefaultDescription
selInt Selector.


setCheckButtonTarget(tgt, checkVal=False)

Sets the message target of the check button or the radio button.

ArgumentTypeDefaultDescription
tgtFXObject Target.
checkValBoolFalseValue of check button.


setCurrentItem(index)

Sets the current item (the index is zero-based).

ArgumentTypeDefaultDescription
indexInt Index.


setEditable(edit=True)

Sets the editable state for the input field.

ArgumentTypeDefaultDescription
editBoolTrueEditable state.


setFocusAndSelection()

Moves the focus to the input field and selects its contents if the combo box is editable.


setFocusToCheckButton()

Moves the focus to the check button or the radio button (if existed) of the widget.


setFocusToComboBox()

Moves the focus to the input field of the widget.


setHelpText(text)

Sets the status line help text.

ArgumentTypeDefaultDescription
textString Help text.


setItemData(index, ptr)

Sets the data for the specified item.

ArgumentTypeDefaultDescription
indexInt Index.
ptrString Data.


setItemProvider(cp)

Sets the provider of this object items.

ArgumentTypeDefaultDescription
cpFXObject Item provider.


setItemText(index, text)

Sets the text for the specified item.

ArgumentTypeDefaultDescription
indexInt Index.
textString Text.


setLabelFont(fnt)

Sets the label font.

ArgumentTypeDefaultDescription
fntFXFont Label font.


setLabelText(txt)

Sets the label string.

ArgumentTypeDefaultDescription
txtString Label text.


setMaxVisible(maxVis)

Sets the maximum number of visible items. The combo box will show up to the given maximum number of items in its list. If the combo box has more items, its list will show a scroll bar.

ArgumentTypeDefaultDescription
maxVisInt Maximum number of visible items.


setNumColumns(cols)

Sets the number of columns in the combo box; passing zero will cause the combo box to always have the number of columns equal to the maximum item length.

ArgumentTypeDefaultDescription
colsInt Number of columns.


setNumVisible(nvis)

Sets the number of visible items.

ArgumentTypeDefaultDescription
nvisInt Number of visible items.


setReadOnlyState(readonly=True)

Sets the read-only state of the combo box.

ArgumentTypeDefaultDescription
readonlyBoolTrueRead-only state.


setText(txt)

Sets the text displayed in the input field.

ArgumentTypeDefaultDescription
txtString Input field text.


setTipText(text)

Sets the tool tip message.

ArgumentTypeDefaultDescription
textString Tooltip text.


Class flags

Message ID's.

ID_BUTTON

Label or button ID.

ID_COMBO

Combo box ID.

ID_INCREMENT

Up arrow button ID.

ID_DECREMENT

Down arrow button ID.


Global flags

Flags for AFX combo box options.

AFXCOMBOBOX_CHECKBUTTON

Use a check button instead of a label.

AFXCOMBOBOX_RADIOBUTTON

Use a radio button instead of a label.

AFXCOMBOBOX_VERTICAL

Orient label or button above combo box.

AFXCOMBOBOX_FLOAT

Allow interaction with float keywords.

AFXCOMBOBOX_READONLY

Configure combo box to the read-only state.

AFXCOMBOBOX_SPINNER

Include spinner buttons.