wxRuby Documentation Home

# Wx::ListItem

This class stores information about a ListCtrl item or column.

## Derived from

Object

## Methods

- ListItem.new
- ListItem#clear
- ListItem#get_align
- ListItem#get_background_colour
- ListItem#get_column
- ListItem#get_data
- ListItem#get_font
- ListItem#get_id
- ListItem#get_image
- ListItem#get_mask
- ListItem#get_state
- ListItem#get_text
- ListItem#get_text_colour
- ListItem#get_width
- ListItem#set_align
- ListItem#set_background_colour
- ListItem#set_column
- ListItem#set_data
- ListItem#set_font
- ListItem#set_id
- ListItem#set_image
- ListItem#set_mask
- ListItem#set_state
- ListItem#set_state_mask
- ListItem#set_text
- ListItem#set_text_colour
- ListItem#set_width

### ListItem.new

### ListItem#clear

clear()

Resets the item state to the default.

### ListItem#get_align

ListColumnFormat get_align()

Returns the alignment for this item. Can be one of
LIST_FORMAT_LEFT, LIST_FORMAT_RIGHT or LIST_FORMAT_CENTRE.

### ListItem#get_background_colour

Colour get_background_colour()

Returns the background colour for this item.

### ListItem#get_column

Integer get_column()

Returns the zero-based column; meaningful only in report mode.

### ListItem#get_data

Object get_data()

Returns the ruby object set as client data for this item (see
set_data, or `nil` if no such data is set. Please
note that client data is associated with the item and not with subitems
in columns.

### ListItem#get_font

Font get_font()

Returns the font used to display the item.

### ListItem#get_id

Integer get_id()

Returns the zero-based item position.

### ListItem#get_image

Integer get_image()

Returns the zero-based index of the image
associated with the item into the image list.

### ListItem#get_mask

Integer get_mask()

Returns a bit mask indicating which fields of the structure are valid;
can be any combination of the following values:

LIST_MASK_STATE | GetState is valid.
LIST_MASK_TEXT | GetText is valid.
LIST_MASK_IMAGE | GetImage is valid.
LIST_MASK_DATA | GetData is valid.
LIST_MASK_WIDTH | GetWidth is valid.
LIST_MASK_FORMAT | GetFormat is valid.

### ListItem#get_state

Integer get_state()

Returns a bit field representing the state of the item. Can be any
combination of:

LIST_STATE_DONTCARE | Don’t care what the state is. Win32 only.
LIST_STATE_DROPHILITED | The item is highlighted to receive a drop event. Win32 only.
LIST_STATE_FOCUSED | The item has the focus.
LIST_STATE_SELECTED | The item is selected.
LIST_STATE_CUT | The item is in the cut state. Win32 only.

### ListItem#get_text

String get_text()

Returns the label/header text.

### ListItem#get_text_colour

Colour get_text_colour()

Returns the text colour.

### ListItem#get_width

Integer get_width()

Meaningful only for column headers in report mode. Returns the column width.

### ListItem#set_align

set_align(%(arg-type)ListColumnFormat% align)

Sets the alignment for the item. See also
ListItem#get_align

### ListItem#set_background_colour

set_background_colour(%(arg-type)Colour% colBack)

Sets the background colour for the item.

### ListItem#set_column

set_column(%(arg-type)Integer% col)

Sets the zero-based column. Meaningful only in report mode.

### ListItem#set_data

set_data(%(arg-type)Object% data)

Sets client data for the item, which can be any arbitrary object. Please
note that client data is associated with the item and not with subitem
columns..

### ListItem#set_font

set_font(%(arg-type)Font% font)

Sets the font for the item.

### ListItem#set_id

set_id(%(arg-type)Integer% id)

Sets the zero-based item position.

### ListItem#set_image

set_image(%(arg-type)Integer% image)

Sets the zero-based index of the image associated with the item
into the image list.

### ListItem#set_mask

set_mask(%(arg-type)Integer% mask)

Sets the mask of valid fields. See ListItem#get_mask.

### ListItem#set_state

set_state(%(arg-type)Integer% state)

Sets the item state flags (note that the valid state flags are influenced
by the value of the state mask, see
ListItem#set_state_mask).
See ListItem#get_state for valid flag
values.

### ListItem#set_state_mask

set_state_mask(%(arg-type)Integer% stateMask)

Sets the bitmask that is used to determine which of the state flags
are to be set. See also ListItem#set_state.

### ListItem#set_text

set_text(%(arg-type)String% text)

Sets the text label for the item.

### ListItem#set_text_colour

set_text_colour(%(arg-type)Colour% colText)

Sets the text colour for the item.

### ListItem#set_width

set_width(%(arg-type)Integer% width)

Meaningful only for column headers in report mode. Sets the column width.

[This page automatically generated from the Textile source at 2023-06-09 00:45:36 +0000]