AFXListBox

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


AFXListBox(p, nvis, labelText, 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.
nvisInt Number of visible items.
labelTextString 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, icon=None, sel=0)

Adds an item to the end of the list.

ArgumentTypeDefaultDescription
textString  
iconFXIconNone 
selInt0 


clearItems()

Removes all items from the list.


create()

Creates the list box.

Reimplemented from FXComposite.


disable()

Disables the list box.

Reimplemented from FXWindow.


enable()

Enables the list box.

Reimplemented from FXWindow.


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  


getItemIndexForData(data)

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

ArgumentTypeDefaultDescription
data   


getLabelFont()

Returns the label font.


getLabelText()

Returns the label string.


getNumItems()

Returns the number of items in the list.


getNumVisible()

Returns the number of visible items.


getTipText()

Returns the tool tip message.


insertItem(index, text, icon=None, sel=0)

Inserts a new item at the specified index position.

ArgumentTypeDefaultDescription
indexInt  
textString  
iconFXIconNone 
selInt0 


isItemCurrent(index)

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

ArgumentTypeDefaultDescription
indexInt  


isReadOnlyState()

Returns True if the list box is set to the read-only state.


removeItem(index)

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

ArgumentTypeDefaultDescription
indexInt  


replaceItem(index, text, icon=None, sel=0)

Replaces the item at the specified index position.

ArgumentTypeDefaultDescription
indexInt  
textString  
iconFXIconNone 
selInt0 


setCurrentItem(index, notify=False)

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

ArgumentTypeDefaultDescription
indexInt  
notifyBoolFalse 


setHelpText(text)

Sets the status line help text.

ArgumentTypeDefaultDescription
textString  


setItemData(index, ptr)

Sets the data for the specified item.

ArgumentTypeDefaultDescription
indexInt  
ptrString  


setLabelFont(fnt)

Sets the label font.

ArgumentTypeDefaultDescription
fntFXFont  


setLabelText(txt)

Sets the label string.

ArgumentTypeDefaultDescription
txtString  


setNumVisible(nvis)

Sets the number of visible items.

ArgumentTypeDefaultDescription
nvisInt  


setReadOnlyState(readonly=True)

Sets the read-only state of the list box.

ArgumentTypeDefaultDescription
readonlyBoolTrue 


setTipText(text)

Sets the tool tip message.

ArgumentTypeDefaultDescription
textString  


Class flags

Message ID's.

ID_LIST

ID for the list box.

ID_FIELD

ID for the text field.


Global flags

Flags for AFX list box options.

AFXLISTBOX_VERTICAL

Orient label above list box.

AFXLISTBOX_READONLY

Configure list box to the read-only state.