 wx.ListItem¶
 wx.ListItem¶This class stores information about a wx.ListCtrl item or column.
wx.ListItem is a class which contains information about:
The zero based index into an image list; see GetImage  and SetImage.
For columns only: the width of the column; see SetWidth  and GetWidth.
For columns only: the format of the column; one of  LIST_FORMAT_LEFT ,   LIST_FORMAT_RIGHT ,   LIST_FORMAT_CENTRE . See  SetAlign  and GetAlign.
The state of the item; see SetState  and GetState. This is a bitlist of the following flags:
LIST_STATE_FOCUSED:   The item has the focus.
LIST_STATE_SELECTED:   The item is selected.
LIST_STATE_DONTCARE:   No special flags (the value of this constant is 0).
LIST_STATE_DROPHILITED:   The item is highlighted to receive a drop event. Win32 only.
LIST_STATE_CUT:   The item is in the cut state. Win32 only.
A mask indicating which state flags are valid; this is a bitlist of the flags reported above for the item state. See SetStateMask  and GetStateMask().
A mask indicating which fields of this class are valid; see SetMask  and GetMask. This is a bitlist of the following flags:
LIST_MASK_STATE:   The state field is valid.
LIST_MASK_TEXT:   The label field is valid.
LIST_MASK_IMAGE:   The image field is valid.
LIST_MASK_DATA:   The application-defined data field is valid.
LIST_MASK_WIDTH:   The column width field is valid.
LIST_MASK_FORMAT:   The column format field is valid.
The   wx.ListItem  object can also contain item-specific colour and font information: for this you need to call one of SetTextColour, SetBackgroundColour  or SetFont  functions on it passing it the colour/font to use. If the colour/font is not specified, the default list control colour/font is used.
See also
 Class Hierarchy¶
 Class Hierarchy¶ Inheritance diagram for class ListItem:
Inheritance diagram for class ListItem:
 Methods Summary¶
 Methods Summary¶| Constructor. | |
| Resets the item state to the default. | |
| Returns the alignment for this item. | |
| Returns the background colour for this item. | |
| Returns the zero-based column; meaningful only in report mode. | |
| Returns client data associated with the control. | |
| Returns the font used to display the item. | |
| Returns the zero-based item position. | |
| Returns the zero-based index of the image associated with the item into the image list. | |
| Returns a bit mask indicating which fields of the structure are valid. | |
| Returns a bit field representing the state of the item. | |
| Returns the label/header text. | |
| Returns the text colour. | |
| Meaningful only for column headers in report mode. | |
| Sets the alignment for the item. | |
| Sets the background colour for the item. | |
| Sets the zero-based column. | |
| Sets client data for the item. | |
| Sets the font for the item. | |
| Sets the zero-based item position. | |
| Sets the zero-based index of the image associated with the item into the image list. | |
| Sets the mask of valid fields. | |
| Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see  | |
| Sets the bitmask that is used to determine which of the state flags are to be set. | |
| Sets the text label for the item. | |
| Sets the text colour for the item. | |
| Meaningful only for column headers in report mode. | 
 Properties Summary¶
 Properties Summary¶| See  | |
 Class API¶
 Class API¶Possible constructors:
ListItem() -> None
This class stores information about a ListCtrl item or column.
Constructor.
None
Resets the item state to the default.
None
Returns the alignment for this item.
Can be one of  LIST_FORMAT_LEFT ,   LIST_FORMAT_RIGHT   or   LIST_FORMAT_CENTRE .
Returns the zero-based column; meaningful only in report mode.
int
Returns client data associated with the control.
Please note that client data is associated with the item and not with subitems.
int
Returns the zero-based item position.
int
Returns the zero-based index of the image associated with the item into the image list.
int
Returns a bit mask indicating which fields of the structure are valid.
Can be any combination of the following values:
wx.LIST_MASK_STATE: GetState  is valid.
wx.LIST_MASK_TEXT: GetText  is valid.
wx.LIST_MASK_IMAGE: GetImage  is valid.
wx.LIST_MASK_DATA: GetData  is valid.
wx.LIST_MASK_WIDTH: GetWidth  is valid.
wx.LIST_MASK_FORMAT: GetFormat  is valid.
int
Returns a bit field representing the state of the item.
Can be any combination of:
wx.LIST_STATE_DONTCARE: No special flags (the values of this constant is 0).
wx.LIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only.
wx.LIST_STATE_FOCUSED: The item has the focus.
wx.LIST_STATE_SELECTED: The item is selected.
wx.LIST_STATE_CUT: The item is in the cut state. Win32 only.
int
Returns the label/header text.
str
Meaningful only for column headers in report mode.
Returns the column width.
int
Sets the alignment for the item.
See also GetAlign
align (ListColumnFormat)
None
Sets the background colour for the item.
colBack (wx.Colour)
None
Sets the zero-based column.
Meaningful only in report mode.
col (int)
None
Sets client data for the item.
Please note that client data is associated with the item and not with subitems.
data (long)
None
Sets the zero-based item position.
id (long)
None
Sets the zero-based index of the image associated with the item into the image list.
image (int)
None
Sets the mask of valid fields.
See GetMask .
mask (long)
None
Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see wx.ListItem.SetStateMask ).
See GetState   for valid flag values.
state (long)
None
Sets the bitmask that is used to determine which of the state flags are to be set.
See also SetState .
stateMask (long)
None
Sets the text label for the item.
text (string)
None
Sets the text colour for the item.
colText (wx.Colour)
None
Meaningful only for column headers in report mode.
Sets the column width.
width (int)
None
See GetTextColour and SetTextColour