Search documentation of wx

# View Source wxListEvent (wx v2.4.3)

A list event holds information about events associated with `wxListCtrl` objects.

See: `wxListCtrl`

This class is derived, and can use functions, from:

- `wxNotifyEvent`

- `wxCommandEvent`

- `wxEvent`

wxWidgets docs: wxListEvent

## Events

Use `wxEvtHandler:connect/3` with `wxListEventType` to subscribe to events of this type.

# Summary

## Types

wxList()
wxListEvent()
wxListEventType()

## Functions

getCacheFrom(This)

For `EVT\_LIST\_CACHE\_HINT` event only: return the first item which the list control advises us to cache.

getCacheTo(This)

For `EVT\_LIST\_CACHE\_HINT` event only: return the last item (inclusive) which the list control advises us to cache.

getColumn(This)

The column position: it is only used with `COL` events.

getData(This)

The data.

getImage(This)

The image.

getIndex(This)

The item index.

getItem(This)

An item object, used by some events.

getKeyCode(This)

Key code if the event is a keypress event.

getLabel(This)

The (new) item label for `EVT_LIST_END_LABEL_EDIT` event.

getMask(This)

The mask.

getPoint(This)

The position of the mouse pointer if the event is a drag event.

getText(This)

The text.

isEditCancelled(This)

This method only makes sense for `EVT\_LIST\_END\_LABEL\_EDIT` message and returns true if it the label editing has been cancelled by the user (`getLabel/1` returns an empty string in this case but it doesn't allow the application to distinguish between really cancelling the edit and the admittedly rare case when the user wants to rename it to an empty string).

# Types

Link to this type

# wxList()

View Source

    -type wxList() ::
              #wxList{type :: wxListEvent:wxListEventType(),
                      code :: integer(),
                      oldItemIndex :: integer(),
                      itemIndex :: integer(),
                      col :: integer(),
                      pointDrag :: {X :: integer(), Y :: integer()}}.

Link to this type

# wxListEvent()

View Source

    -type wxListEvent() :: wx:wx_object().

Link to this type

# wxListEventType()

View Source

    -type wxListEventType() ::
              command_list_begin_drag | command_list_begin_rdrag | command_list_begin_label_edit |
              command_list_end_label_edit | command_list_delete_item | command_list_delete_all_items |
              command_list_key_down | command_list_insert_item | command_list_col_click |
              command_list_col_right_click | command_list_col_begin_drag | command_list_col_dragging |
              command_list_col_end_drag | command_list_item_selected | command_list_item_deselected |
              command_list_item_right_click | command_list_item_middle_click | command_list_item_activated |
              command_list_item_focused | command_list_cache_hint.

# Functions

Link to this function

# getCacheFrom(This)

View Source

    -spec getCacheFrom(This) -> integer() when This :: wxListEvent().

For `EVT\_LIST\_CACHE\_HINT` event only: return the first item which the list control advises us to cache.

Link to this function

# getCacheTo(This)

View Source

    -spec getCacheTo(This) -> integer() when This :: wxListEvent().

For `EVT\_LIST\_CACHE\_HINT` event only: return the last item (inclusive) which the list control advises us to cache.

Link to this function

# getColumn(This)

View Source

    -spec getColumn(This) -> integer() when This :: wxListEvent().

The column position: it is only used with `COL` events.

For the column dragging events, it is the column to the left of the divider being dragged, for the column click events it may be -1 if the user clicked in the list control header outside any column.

Link to this function

# getData(This)

View Source

    -spec getData(This) -> integer() when This :: wxListEvent().

The data.

Link to this function

# getImage(This)

View Source

    -spec getImage(This) -> integer() when This :: wxListEvent().

The image.

Link to this function

# getIndex(This)

View Source

    -spec getIndex(This) -> integer() when This :: wxListEvent().

The item index.

Link to this function

# getItem(This)

View Source

    -spec getItem(This) -> wxListItem:wxListItem() when This :: wxListEvent().

An item object, used by some events.

See also `wxListCtrl:setItem/5`.

Link to this function

# getKeyCode(This)

View Source

    -spec getKeyCode(This) -> integer() when This :: wxListEvent().

Key code if the event is a keypress event.

Link to this function

# getLabel(This)

View Source

    -spec getLabel(This) -> unicode:charlist() when This :: wxListEvent().

The (new) item label for `EVT_LIST_END_LABEL_EDIT` event.

Link to this function

# getMask(This)

View Source

    -spec getMask(This) -> integer() when This :: wxListEvent().

The mask.

Link to this function

# getPoint(This)

View Source

    -spec getPoint(This) -> {X :: integer(), Y :: integer()} when This :: wxListEvent().

The position of the mouse pointer if the event is a drag event.

Link to this function

# getText(This)

View Source

    -spec getText(This) -> unicode:charlist() when This :: wxListEvent().

The text.

Link to this function

# isEditCancelled(This)

View Source

    -spec isEditCancelled(This) -> boolean() when This :: wxListEvent().

This method only makes sense for `EVT\_LIST\_END\_LABEL\_EDIT` message and returns true if it the label editing has been cancelled by the user (`getLabel/1` returns an empty string in this case but it doesn't allow the application to distinguish between really cancelling the edit and the admittedly rare case when the user wants to rename it to an empty string).