phoenix_title wx.ListEvent

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

events Events Emitted by this Class

Handlers bound for the following event types will receive a wx.ListEvent parameter.

  • EVT_LIST_BEGIN_DRAG: Begin dragging with the left mouse button.

  • EVT_LIST_BEGIN_RDRAG: Begin dragging with the right mouse button.

  • EVT_LIST_BEGIN_LABEL_EDIT: Begin editing a label. This can be prevented by calling Veto

  • EVT_LIST_END_LABEL_EDIT: Finish editing a label. This can be prevented by calling Veto

  • EVT_LIST_DELETE_ITEM: Delete an item.

  • EVT_LIST_DELETE_ALL_ITEMS: Delete all items.

  • EVT_LIST_ITEM_SELECTED: The item has been selected.

  • EVT_LIST_ITEM_DESELECTED: The item has been deselected.

  • EVT_LIST_ITEM_ACTIVATED: The item has been activated (ENTER or double click).

  • EVT_LIST_ITEM_FOCUSED: The currently focused item has changed.

  • EVT_LIST_ITEM_MIDDLE_CLICK: The middle mouse button has been clicked on an item.

  • EVT_LIST_ITEM_RIGHT_CLICK: The right mouse button has been clicked on an item.

  • EVT_LIST_KEY_DOWN: A key has been pressed. GetIndex may be -1 if no item is selected.

  • EVT_LIST_INSERT_ITEM: An item has been inserted.

  • EVT_LIST_COL_CLICK: A column (m_col) has been left-clicked.

  • EVT_LIST_COL_RIGHT_CLICK: A column (m_col) (which can be -1 if the click occurred outside any column) has been right-clicked.

  • EVT_LIST_COL_BEGIN_DRAG: The user started resizing a column - can be vetoed.

  • EVT_LIST_COL_DRAGGING: The divider between columns is being dragged.

  • EVT_LIST_COL_END_DRAG: A column has been resized by the user.

  • EVT_LIST_CACHE_HINT: Prepare cache for a virtual list control

See also

wx.ListCtrl


class_hierarchy Class Hierarchy

Inheritance diagram for class ListEvent:

method_summary Methods Summary

__init__

Constructor.

GetCacheFrom

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

GetCacheTo

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

GetColumn

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

GetData

The data.

GetImage

The image.

GetIndex

The item index.

GetItem

An item object, used by some events.

GetKeyCode

Key code if the event is a keypress event.

GetLabel

The (new) item label for EVT_LIST_END_LABEL_EDIT event.

GetMask

The mask.

GetPoint

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

GetText

The text.

IsEditCancelled

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 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).

SetCacheFrom

SetCacheTo

SetColumn

SetIndex

SetItem

SetKeyCode

SetPoint


property_summary Properties Summary

CacheFrom

See GetCacheFrom and SetCacheFrom

CacheTo

See GetCacheTo and SetCacheTo

Column

See GetColumn and SetColumn

Data

See GetData

Image

See GetImage

Index

See GetIndex and SetIndex

Item

See GetItem and SetItem

KeyCode

See GetKeyCode and SetKeyCode

Label

See GetLabel

Mask

See GetMask

Point

See GetPoint and SetPoint

Text

See GetText


api Class API

class wx.ListEvent(NotifyEvent)

Possible constructors:

ListEvent(commandType=wxEVT_NULL, id=0)

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

__init__(self, commandType=wxEVT_NULL, id=0)

Constructor.

Parameters
  • commandType (wx.EventType) –

  • id (int) –

GetCacheFrom(self)

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

Return type

long

GetCacheTo(self)

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

Return type

long

GetColumn(self)

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.

Return type

int

GetData(self)

The data.

Return type

wx.UIntPtr

GetImage(self)

The image.

Return type

int

GetIndex(self)

The item index.

Return type

long

GetItem(self)

An item object, used by some events.

See also wx.ListCtrl.SetItem .

Return type

wx.ListItem

GetKeyCode(self)

Key code if the event is a keypress event.

Return type

int

GetLabel(self)

The (new) item label for EVT_LIST_END_LABEL_EDIT event.

Return type

string

GetMask(self)

The mask.

Return type

long

GetPoint(self)

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

Return type

wx.Point

GetText(self)

The text.

Return type

string

IsEditCancelled(self)

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 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).

Return type

bool

SetCacheFrom(self, cacheFrom)
Parameters

cacheFrom (long) –

See also

GetCacheFrom

SetCacheTo(self, cacheTo)
Parameters

cacheTo (long) –

See also

GetCacheTo

SetColumn(self, col)
Parameters

col (int) –

See also

GetColumn

SetIndex(self, index)
Parameters

index (long) –

See also

GetIndex

SetItem(self, item)
Parameters

item (wx.ListItem) –

See also

GetItem

SetKeyCode(self, code)
Parameters

code (int) –

See also

GetKeyCode

SetPoint(self, point)
Parameters

point (wx.Point) –

See also

GetPoint

CacheFrom

See GetCacheFrom and SetCacheFrom

CacheTo

See GetCacheTo and SetCacheTo

Column

See GetColumn and SetColumn

Data

See GetData

Image

See GetImage

Index

See GetIndex and SetIndex

Item

See GetItem and SetItem

KeyCode

See GetKeyCode and SetKeyCode

Label

See GetLabel

Mask

See GetMask

Point

See GetPoint and SetPoint

Text

See GetText