wx.ListEvent

Inheritance diagram for wx.ListEvent:



Description

A list event holds information about events associated with wx.ListCtrl objects.

See also

wx.ListCtrl

Event Handling

Event Name Description
wx.EVT_LIST_BEGIN_DRAG(id, func) Begin dragging with the left mouse button.
wx.EVT_LIST_BEGIN_RDRAG(id, func) Begin dragging with the right mouse button.
wx.EVT_LIST_BEGIN_LABEL_EDIT(id, func) Begin editing a label. This can be prevented by calling Veto().
wx.EVT_LIST_END_LABEL_EDIT(id, func) Finish editing a label. This can be prevented by calling Veto().
wx.EVT_LIST_DELETE_ITEM(id, func) Delete an item.
wx.EVT_LIST_DELETE_ALL_ITEMS(id, func) Delete all items.
wx.EVT_LIST_ITEM_SELECTED(id, func) The item has been selected.
wx.EVT_LIST_ITEM_DESELECTED(id, func) The item has been deselected.
wx.EVT_LIST_ITEM_ACTIVATED(id, func) The item has been activated (ENTER or double click).
wx.EVT_LIST_ITEM_FOCUSED(id, func) The currently focused item has changed.
wx.EVT_LIST_ITEM_MIDDLE_CLICK(id, func) The middle mouse button has been clicked on an item.
wx.EVT_LIST_ITEM_RIGHT_CLICK(id, func) The right mouse button has been clicked on an item.
wx.EVT_LIST_KEY_DOWN(id, func) A key has been pressed.
wx.EVT_LIST_INSERT_ITEM(id, func) An item has been inserted.
wx.EVT_LIST_COL_CLICK(id, func) A column has been left-clicked.
wx.EVT_LIST_COL_RIGHT_CLICK(id, func) A column (which can be -1 if the click occurred outside any column) has been right-clicked.
wx.EVT_LIST_COL_BEGIN_DRAG(id, func) The user started resizing a column - can be vetoed.
wx.EVT_LIST_COL_DRAGGING(id, func) The divider between columns is being dragged.
wx.EVT_LIST_COL_END_DRAG(id, func) A column has been resized by the user.
wx.EVT_LIST_CACHE_HINT(id, func) Prepare cache for a virtual list control.

Class API

Methods

__init__(commandType=wx.wxEVT_NULL, id=0)

Constructor.

Parameters:

  • commandType (eventtype)
  • id (int)

Returns:

wx.ListEvent


GetCacheFrom()

For wx.EVT_LIST_CACHE_HINT event only: return the first item which the list control advises us to cache.


Returns:

long


GetCacheTo()

For wx.EVT_LIST_CACHE_HINT event only: return the last item (inclusive) which the list control advises us to cache.


Returns:

long


GetColumn()

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.


Returns:

int


GetData()

The data.


Returns:

long


GetImage()

The image.


Returns:

int


GetIndex()

The item index.


Returns:

long


GetItem()

An item object, used by some events. See also wx.ListCtrl.SetItem.


Returns:

wx.ListItem


GetKeyCode()

Key code if the event is a keypress event.


Returns:

int


GetLabel()

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


Returns:

string


GetMask()

The mask.


Returns:

long


GetPoint()

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


Returns:

wx.Point


GetText()

The text.


Returns:

string


IsEditCancelled()

This method only makes sense for wx.EVT_LIST_END_LABEL_EDIT message and returns True if it the label editing has been cancelled by the user (GetLabel 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).


Returns:

bool


SetEditCanceled(editCancelled)

Parameters:

  • editCancelled (bool)

Properties

CacheFrom
See GetCacheFrom
CacheTo
See GetCacheTo
Column
See GetColumn
Data
See GetData
Image
See GetImage
Index
See GetIndex
Item
See GetItem
KeyCode
See GetKeyCode
Label
See GetLabel
Mask
See GetMask
Point
See GetPoint
Text
See GetText
m_code
See GetKeyCode
m_col
See GetColumn
m_item
See GetItem
m_itemIndex
See GetIndex
m_oldItemIndex
m_pointDrag
See GetPoint