Home | Trees | Index | Help |
|
---|
Package wx :: Class ItemContainer |
|
object
--+
|
ItemContainer
ComboBox
,
ControlWithItems
,
OwnerDrawnComboBox
,
SimpleHtmlListBox
The wx.ItemContainer class defines an interface which is implemented
by all controls which have string subitems, each of which may be
selected, such as wx.ListBox
, wx.CheckListBox
, wx.Choice
as well
as wx.ComboBox
which implements an extended interface deriving from
this one.
It defines the methods for accessing the control's items and although each of the derived classes implements them differently, they still all conform to the same interface.
The items in a wx.ItemContainer have (non empty) string labels and, optionally, client data associated with them.
Method Summary | |
---|---|
__init__(self)
| |
int |
Adds the item to the control, associating the given data with the item if not None. |
Apend several items at once to the control. | |
Removes all items from the control. | |
Deletes the item at the zero-based index 'n' from the control. | |
int |
Finds an item whose label matches the given string. |
PyObject |
Returns the client data associated with the given item, (if any.) |
int |
Returns the number of items in the control. |
Return a list of the strings in the control | |
int |
Returns the index of the selected item or wx.NOT_FOUND if no item is selected. |
String |
Returns the label of the item with the given index. |
wxArrayString | GetStrings(self)
|
String |
Returns the label of the selected item or an empty string if no item is selected. |
int |
Insert an item into the control before the item at the pos index, optionally associating some data object with the item. |
bool |
Returns True if the control is empty or False if it has some items. |
This is the same as SetSelection and exists only because it is
slightly more natural for controls which support multiple selection. | |
Associate the given client data with the item at position n. | |
Clear and set the strings in the control from a list | |
Sets the item at index 'n' to be the selected item. | |
Sets the label for the given item. | |
bool | SetStringSelection(self,
s)
|
Property Summary | |
---|---|
Count : See GetCount | |
Items : See GetItems and SetItems | |
Selection : See GetSelection and SetSelection | |
Strings : See GetStrings | |
StringSelection : See GetStringSelection and SetStringSelection | |
thisown : The membership flag |
Method Details |
---|
Append(self, item, clientData=None)Adds the item to the control, associating the given data with the item if not None. The return value is the index of the newly added item which may be different from the last one if the control is sorted (e.g. has wx.LB_SORT or wx.CB_SORT style).
|
AppendItems(self, strings)Apend several items at once to the control. Notice that calling this method may be much faster than appending the items one by one if you need to add a lot of items.
|
Clear(self)Removes all items from the control. |
Delete(self, n)Deletes the item at the zero-based index 'n' from the control. Note
that it is an error (signalled by a
|
FindString(self, s)Finds an item whose label matches the given string. Returns the zero-based position of the item, or wx.NOT_FOUND if the string was not found.
|
GetClientData(self, n)Returns the client data associated with the given item, (if any.)
|
GetCount(self)Returns the number of items in the control.
|
GetItems(self)Return a list of the strings in the control |
GetSelection(self)Returns the index of the selected item or wx.NOT_FOUND if no item is selected.
|
GetString(self, n)Returns the label of the item with the given index.
|
GetStringSelection(self)Returns the label of the selected item or an empty string if no item is selected.
|
Insert(self, item, pos, clientData=None)Insert an item into the control before the item at the pos index, optionally associating some data object with the item.
|
IsEmpty(self)Returns True if the control is empty or False if it has some items.
|
Select(self, n)This is the same as
|
SetClientData(self, n, clientData)Associate the given client data with the item at position n.
|
SetItems(self, items)Clear and set the strings in the control from a list |
SetSelection(self, n)Sets the item at index 'n' to be the selected item.
|
SetString(self, n, s)Sets the label for the given item.
|
Property Details |
---|
CountSee
|
Items |
SelectionSee
|
StringsSee
|
StringSelectionSee
|
thisownThe membership flag |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:38 2007 | http://epydoc.sf.net |