wxListItem(3)
β¨ wxListItem β¨
okay bestie, so this is wxListItem(3) from the Erlang module definitions, and it's literally the lil' info packet that holds everything your list control needs to know about one row or one column π
πΈ NAME πΈ
wxListItem β this class stores information about a wxListCtrl item or column. that's it, that's the glow-up π
π DESCRIPTION π
so wxListItem is a class that's basically a gossip folder full of info about:
- Zero based item position β peek at
setId/2andgetId/1π - Zero based column index β see
setColumn/2andgetColumn/1 - The label (or header, for columns) β see
setText/2andgetText/1 - The zero based index into an image list β see
getImage/1andsetImage/2 - Application defined data β see
SetData()(not implemented in wx) andGetData()(not implemented in wx) π - For columns only: the width of the column β see
setWidth/2andgetWidth/1 - For columns only: the format of the column β one of
wxLIST_FORMAT_LEFT,wxLIST_FORMAT_RIGHT,wxLIST_FORMAT_CENTRE. SeesetAlign/2andgetAlign/1 - The state of the item β see
setState/2andgetState/1. This is a bitlist of the following flags:wxLIST_STATE_FOCUSED: the item has the focuswxLIST_STATE_SELECTED: the item is selectedwxLIST_STATE_DONTCARE: no special flags (the value of this constant is0)wxLIST_STATE_DROPHILITED: the item is highlighted to receive a drop event. Win32 only.wxLIST_STATE_CUT: the item is in the cut state. Win32 only.
- mask indicating which state flags are valid β this is a bitlist of the flags reported above for the item state. See
setStateMask/2andGetStateMask() - mask indicating which fields of this class are valid β see
setMask/2andgetMask/1. This is a bitlist of the following flags:wxLIST_MASK_STATE: the state field is validwxLIST_MASK_TEXT: the label field is validwxLIST_MASK_IMAGE: the image field is validwxLIST_MASK_DATA: the application-defined data field is validwxLIST_MASK_WIDTH: the column width field is validwxLIST_MASK_FORMAT: the column format field is valid
the way that the wxListItem object can also carry item-specific colour and font info π for that you need to call one of setTextColour/2, setBackgroundColour/2 or setFont/2 on it, passing it the colour/font you wanna use. If the colour/font is not specified, the default list control colour/font is used. no cap β¨
See: wxListCtrl
wxWidgets docs: wxListItem
π¦ DATA TYPES π¦
wxListItem() :: wx:wx_object().
π₯ FUNCTIONS π₯
clear(This) -> okwhenThis :: wxListItem().
Resets the item state to the default. clean slate, fresh start, main character energy π§
destroy(This :: wxListItem()) -> ok.
Destroys the object. it's over bestie π
getAlign(This) -> wx:wx_enum()whenThis :: wxListItem().
Returns the alignment for this item.
Can be one of wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT or wxLIST_FORMAT_CENTRE.
getBackgroundColour(This) -> wx:wx_colour4()whenThis :: wxListItem().
Returns the background colour for this item. π¨
getColumn(This) -> integer()whenThis :: wxListItem().
Returns the zero-based column; meaningful only in report mode.
getFont(This) -> wxFont:wxFont()whenThis :: wxListItem().
Returns the font used to display the item.
getId(This) -> integer()whenThis :: wxListItem().
Returns the zero-based item position.
getImage(This) -> integer()whenThis :: wxListItem().
Returns the zero-based index of the image associated with the item into the image list.
getMask(This) -> integer()whenThis :: wxListItem().
Returns a bit mask indicating which fields of the structure are valid.
Can be any combination of the following values:
wxLIST_MASK_STATE:GetStateis valid.wxLIST_MASK_TEXT:GetTextis valid.wxLIST_MASK_IMAGE:GetImageis valid.wxLIST_MASK_DATA:GetDatais valid.wxLIST_MASK_WIDTH:GetWidthis valid.wxLIST_MASK_FORMAT:GetFormatis valid.
getState(This) -> integer()whenThis :: wxListItem().
Returns a bit field representing the state of the item.
Can be any combination of:
wxLIST_STATE_DONTCARE: no special flags (the values of this constant is0).wxLIST_STATE_DROPHILITED: the item is highlighted to receive a drop event. Win32 only.wxLIST_STATE_FOCUSED: the item has the focus.wxLIST_STATE_SELECTED: the item is selected.wxLIST_STATE_CUT: the item is in the cut state. Win32 only.
getText(This) -> unicode:charlist()whenThis :: wxListItem().
Returns the label/header text. π
getTextColour(This) -> wx:wx_colour4()whenThis :: wxListItem().
Returns the text colour.
getWidth(This) -> integer()whenThis :: wxListItem().
Meaningful only for column headers in report mode.
Returns the column width.
new() -> wxListItem().
Constructor. β¨
new(Item) -> wxListItem()whenItem :: wxListItem().setAlign(This, Align) -> ok
when This :: wxListItem(), Align :: wx:wx_enum().
Sets the alignment for the item.
See also getAlign/1
setBackgroundColour(This, ColBack) -> ok
when
This :: wxListItem(),
ColBack :: wx:wx_colour().
Sets the background colour for the item.
setColumn(This, Col) -> ok
when This :: wxListItem(), Col :: integer().
Sets the zero-based column.
Meaningful only in report mode.
setFont(This, Font) -> ok
when This :: wxListItem(), Font :: wxFont:wxFont().
Sets the font for the item.
setId(This, Id) -> okwhenThis :: wxListItem(), Id :: integer().
Sets the zero-based item position.
setImage(This, Image) -> ok
when This :: wxListItem(), Image :: integer().
Sets the zero-based index of the image associated with the item into the image list.
setMask(This, Mask) -> ok
when This :: wxListItem(), Mask :: integer().
Sets the mask of valid fields.
See getMask/1.
setState(This, State) -> ok
when This :: wxListItem(), State :: integer().
Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see setStateMask/2).
See getState/1 for valid flag values.
setStateMask(This, StateMask) -> ok
when This :: wxListItem(), StateMask :: integer().
Sets the bitmask that is used to determine which of the state flags are to be set.
See also setState/2.
setText(This, Text) -> ok
when This :: wxListItem(), Text :: unicode:chardata().
Sets the text label for the item.
setTextColour(This, ColText) -> ok
when
This :: wxListItem(),
ColText :: wx:wx_colour().
Sets the text colour for the item.
setWidth(This, Width) -> ok
when This :: wxListItem(), Width :: integer().
Meaningful only for column headers in report mode.
Sets the column width.
and that's the whole thing, bestie π this lil' page came to you straight from Ericsson AB, rockin' wx 2.6, dated with the wxListItem(3) tag π go forth and slay your list controls, periodt π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms