Class: Wx::ListItem
Overview
This class stores information about a ListCtrl item or column.
ListItem is a class which contains information about:
-
Zero based column index; see #set_column and #get_column.
-
The label (or header for columns); see #set_text and #get_text.
-
The zero based index into an image list; see #get_image and #set_image.
-
Application defined data; see #set_data and get_data.
-
For columns only: the width of the column; see #set_width and #get_width.
-
For columns only: the format of the column; one of Wx::ListColumnFormat::LIST_FORMAT_LEFT, Wx::ListColumnFormat::LIST_FORMAT_RIGHT, Wx::ListColumnFormat::LIST_FORMAT_CENTRE. See #set_align and #get_align.
-
The state of the item; see #set_state and #get_state. 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 #set_state_mask and GetStateMask().
-
A mask indicating which fields of this class are valid; see #set_mask and #get_mask. 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 ListItem object can also contain item-specific colour and font information: for this you need to call one of #set_text_colour, #set_background_colour or #set_font 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.
Category: Data Structures
Instance Method Summary collapse
-
#clear ⇒ void
Resets the item state to the default.
-
#get_align ⇒ Wx::ListColumnFormat
(also: #align)
Returns the alignment for this item.
-
#get_background_colour ⇒ Wx::Colour
(also: #background_colour)
Returns the background colour for this item.
-
#get_column ⇒ Integer
(also: #column)
Returns the zero-based column; meaningful only in report mode.
-
#get_font ⇒ Wx::Font
(also: #font)
Returns the font used to display the item.
-
#get_id ⇒ Integer
(also: #id)
Returns the zero-based item position.
-
#get_image ⇒ Integer
(also: #image)
Returns the zero-based index of the image associated with the item into the image list.
-
#get_mask ⇒ Integer
(also: #mask)
Returns a bit mask indicating which fields of the structure are valid.
-
#get_state ⇒ Integer
(also: #state)
Returns a bit field representing the state of the item.
-
#get_text ⇒ Wx::String
(also: #text)
Returns the label/header text.
-
#get_text_colour ⇒ Wx::Colour
(also: #text_colour)
Returns the text colour.
-
#get_width ⇒ Integer
(also: #width)
Meaningful only for column headers in report mode.
-
#initialize ⇒ Wx::ListItem
constructor
Constructor.
-
#set_align(align) ⇒ void
(also: #align=)
Sets the alignment for the item.
-
#set_background_colour(colBack) ⇒ void
(also: #background_colour=)
Sets the background colour for the item.
-
#set_column(col) ⇒ void
(also: #column=)
Sets the zero-based column.
-
#set_data(data) ⇒ void
(also: #data=)
Sets client data for the item.
-
#set_font(font) ⇒ void
(also: #font=)
Sets the font for the item.
-
#set_id(id) ⇒ void
(also: #id=)
Sets the zero-based item position.
-
#set_image(image) ⇒ void
(also: #image=)
Sets the zero-based index of the image associated with the item into the image list.
-
#set_mask(mask) ⇒ void
(also: #mask=)
Sets the mask of valid fields.
-
#set_state(state) ⇒ void
(also: #state=)
Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see #set_state_mask).
-
#set_state_mask(stateMask) ⇒ void
(also: #state_mask=)
Sets the bitmask that is used to determine which of the state flags are to be set.
-
#set_text(text) ⇒ void
(also: #text=)
Sets the text label for the item.
-
#set_text_colour(colText) ⇒ void
(also: #text_colour=)
Sets the text colour for the item.
-
#set_width(width) ⇒ void
(also: #width=)
Meaningful only for column headers in report mode.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::ListItem
Constructor.
1435 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1435 def initialize; end |
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
Resets the item state to the default.
1439 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1439 def clear; end |
#get_align ⇒ Wx::ListColumnFormat Also known as: align
Returns the alignment for this item.
Can be one of Wx::ListColumnFormat::LIST_FORMAT_LEFT, Wx::ListColumnFormat::LIST_FORMAT_RIGHT or Wx::ListColumnFormat::LIST_FORMAT_CENTRE.
1445 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1445 def get_align; end |
#get_background_colour ⇒ Wx::Colour Also known as: background_colour
Returns the background colour for this item.
1450 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1450 def get_background_colour; end |
#get_column ⇒ Integer Also known as: column
Returns the zero-based column; meaningful only in report mode.
1455 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1455 def get_column; end |
#get_font ⇒ Wx::Font Also known as: font
Returns the font used to display the item.
1460 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1460 def get_font; end |
#get_id ⇒ Integer Also known as: id
Returns the zero-based item position.
1465 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1465 def get_id; end |
#get_image ⇒ Integer Also known as: image
Returns the zero-based index of the image associated with the item into the image list.
1470 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1470 def get_image; end |
#get_mask ⇒ Integer Also known as: mask
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.
1484 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1484 def get_mask; end |
#get_state ⇒ Integer Also known as: state
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.
1497 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1497 def get_state; end |
#get_text ⇒ Wx::String Also known as: text
Returns the label/header text.
1502 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1502 def get_text; end |
#get_text_colour ⇒ Wx::Colour Also known as: text_colour
Returns the text colour.
1507 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1507 def get_text_colour; end |
#get_width ⇒ Integer Also known as: width
Meaningful only for column headers in report mode.
Returns the column width.
1514 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1514 def get_width; end |
#set_align(align) ⇒ void Also known as: align=
1522 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1522 def set_align(align) end |
#set_background_colour(colBack) ⇒ void Also known as: background_colour=
This method returns an undefined value.
Sets the background colour for the item.
1528 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1528 def set_background_colour(colBack) end |
#set_column(col) ⇒ void Also known as: column=
This method returns an undefined value.
Sets the zero-based column.
Meaningful only in report mode.
1536 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1536 def set_column(col) end |
#set_data(data) ⇒ void Also known as: data=
This method returns an undefined value.
Sets client data for the item.
Please note that client data is associated with the item and not with subitems.
1430 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1430 def set_data(data) end |
#set_font(font) ⇒ void Also known as: font=
This method returns an undefined value.
Sets the font for the item.
1542 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1542 def set_font(font) end |
#set_id(id) ⇒ void Also known as: id=
This method returns an undefined value.
Sets the zero-based item position.
1548 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1548 def set_id(id) end |
#set_image(image) ⇒ void Also known as: image=
This method returns an undefined value.
Sets the zero-based index of the image associated with the item into the image list.
1554 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1554 def set_image(image) end |
#set_mask(mask) ⇒ void Also known as: mask=
1562 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1562 def set_mask(mask) end |
#set_state(state) ⇒ void Also known as: state=
This method returns an undefined value.
Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see #set_state_mask).
See #get_state for valid flag values.
1570 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1570 def set_state(state) end |
#set_state_mask(stateMask) ⇒ void Also known as: state_mask=
This method returns an undefined value.
Sets the bitmask that is used to determine which of the state flags are to be set.
See also #set_state.
1578 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1578 def set_state_mask(stateMask) end |
#set_text(text) ⇒ void Also known as: text=
This method returns an undefined value.
Sets the text label for the item.
1584 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1584 def set_text(text) end |
#set_text_colour(colText) ⇒ void Also known as: text_colour=
This method returns an undefined value.
Sets the text colour for the item.
1590 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1590 def set_text_colour(colText) end |
#set_width(width) ⇒ void Also known as: width=
This method returns an undefined value.
Meaningful only for column headers in report mode.
Sets the column width.
1598 |
# File 'lib/wx/doc/gen/list_ctrl.rb', line 1598 def set_width(width) end |