Table Of Contents

Previous topic

DataViewCtrl

Next topic

DataViewItem

This Page

phoenix_title DataViewEvent

This is the event class for the DataViewCtrl notifications.

events Events Emitted by this Class

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

  • EVT_DATAVIEW_SELECTION_CHANGED: Process a wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
  • EVT_DATAVIEW_ITEM_ACTIVATED: Process a wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
  • EVT_DATAVIEW_ITEM_EDITING_STARTED: Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
  • EVT_DATAVIEW_ITEM_EDITING_DONE: Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
  • EVT_DATAVIEW_ITEM_COLLAPSING: Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
  • EVT_DATAVIEW_ITEM_COLLAPSED: Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
  • EVT_DATAVIEW_ITEM_EXPANDING: Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
  • EVT_DATAVIEW_ITEM_EXPANDED: Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
  • EVT_DATAVIEW_ITEM_VALUE_CHANGED: Process a wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
  • EVT_DATAVIEW_ITEM_CONTEXT_MENU: Process a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
  • EVT_DATAVIEW_COLUMN_HEADER_CLICK: Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK event.
  • EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK: Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
  • EVT_DATAVIEW_COLUMN_SORTED: Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
  • EVT_DATAVIEW_COLUMN_REORDERED: Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event. Currently this even is only generated when using the native OSX version.
  • EVT_DATAVIEW_ITEM_BEGIN_DRAG: Process a wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
  • EVT_DATAVIEW_ITEM_DROP_POSSIBLE: Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
  • EVT_DATAVIEW_ITEM_DROP: Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
  • EVT_DATAVIEW_CACHE_HINT: Process a wxEVT_COMMAND_DATAVIEW_CACHE_HINT event.

class_hierarchy Inheritance Diagram

Inheritance diagram for class DataViewEvent

Inheritance diagram of DataViewEvent


method_summary Methods Summary

__init__ Constructor.
GetCacheFrom Return the first row that will be displayed.
GetCacheTo Return the last row that will be displayed.
GetColumn Returns the position of the column in the control or -1 if no column field was set by the event emitter.
GetDataBuffer Gets the data buffer for a drop data transfer.
GetDataFormat Gets the DataFormat during a drop operation.
GetDataSize Gets the data size for a drop data transfer.
GetDataViewColumn Returns a pointer to the DataViewColumn from which the event was emitted or None.
GetDropEffect Returns the effect the user requested to happen to the dropped data.
GetModel Returns the DataViewModel associated with the event.
GetPosition Returns the position of a context menu event in screen coordinates.
GetValue Returns a reference to a value.
IsEditCancelled Can be used to determine whether the new value is going to be accepted in wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE handler.
SetColumn Sets the column index associated with this event.
SetDataObject Set DataObject for data transfer within a drag operation.
SetDataViewColumn For wxEVT_DATAVIEW_COLUMN_HEADER_CLICK only.
SetDragFlags Specify the kind of the drag operation to perform.
SetModel Sets the dataview model associated with this event.
SetValue Sets the value associated with this event.

api Class API



class DataViewEvent(NotifyEvent)

This is the event class for the DataViewCtrl notifications.

Possible constructors:

DataViewEvent(commandType=wxEVT_NULL, winid=0)

Methods



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

Constructor.

Typically used by wxWidgets internals only.

Parameters:
  • commandType (EventType) –
  • winid (int) –


GetCacheFrom(self)

Return the first row that will be displayed.

Return type:int


GetCacheTo(self)

Return the last row that will be displayed.

Return type:int


GetColumn(self)

Returns the position of the column in the control or -1 if no column field was set by the event emitter.

Return type:int


GetDataBuffer(self)

Gets the data buffer for a drop data transfer.



GetDataFormat(self)

Gets the DataFormat during a drop operation.

Return type: DataFormat


GetDataSize(self)

Gets the data size for a drop data transfer.

Return type:int


GetDataViewColumn(self)

Returns a pointer to the DataViewColumn from which the event was emitted or None.

Return type: DataViewColumn


GetDropEffect(self)

Returns the effect the user requested to happen to the dropped data.

This function can be used inside wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE and wxEVT_COMMAND_DATAVIEW_ITEM_DROP handlers and returns whether the user is trying to copy (the return value is DragCopy ) or move (if the return value is DragMove ) the data.

Currently this is only available when using the generic version of DataViewCtrl (used e.g. under MSW) and always returns DragNone in the GTK and OS X native versions.

Return type: DragResult

New in version 2.9.4.



GetModel(self)

Returns the DataViewModel associated with the event.

Return type: DataViewModel


GetPosition(self)

Returns the position of a context menu event in screen coordinates.

Return type: Point


GetValue(self)

Returns a reference to a value.

Return type:Variant


IsEditCancelled(self)

Can be used to determine whether the new value is going to be accepted in wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE handler.

Returns True if editing the item was cancelled or if the user tried to enter an invalid value (refused by DataViewRenderer.Validate ). If this method returns False, it means that the value in the model is about to be changed to the new one.

Notice that wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event handler can call NotifyEvent.Veto to prevent this from happening.

Currently support for setting this field and for vetoing the change is only available in the generic version of DataViewCtrl, i.e. under MSW but not GTK nor OS X.

Return type:bool

New in version 2.9.3.



SetColumn(self, col)

Sets the column index associated with this event.

Parameters:col (int) –


SetDataObject(self, obj)

Set DataObject for data transfer within a drag operation.

Parameters:obj (DataObject) –


SetDataViewColumn(self, col)

For wxEVT_DATAVIEW_COLUMN_HEADER_CLICK only.

Parameters:col (dataview.DataViewColumn) –


SetDragFlags(self, flags)

Specify the kind of the drag operation to perform.

This method can be used inside a wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG handler in order to configure the drag operation. Valid values are Drag_CopyOnly (default), Drag_AllowMove (allow the data to be moved) and Drag_DefaultMove .

Currently it is only honoured by the generic version of DataViewCtrl (used e.g. under MSW) and not supported by the native GTK and OS X versions.

Parameters:flags (int) –

New in version 2.9.4.

See also

GetDropEffect



SetModel(self, model)

Sets the dataview model associated with this event.

Parameters:model (dataview.DataViewModel) –


SetValue(self, value)

Sets the value associated with this event.

Parameters:value (Variant) –

Properties



CacheFrom

See GetCacheFrom



CacheTo

See GetCacheTo



Column

See GetColumn and SetColumn



DataBuffer

See GetDataBuffer



DataFormat

See GetDataFormat



DataSize

See GetDataSize



DataViewColumn

See GetDataViewColumn and SetDataViewColumn



DropEffect

See GetDropEffect



Model

See GetModel and SetModel



Position

See GetPosition



Value

See GetValue and SetValue