phoenix_title wx.propgrid.PropertyGridEvent

A property grid event holds information about events associated with wx.propgrid.PropertyGrid objects.

To process input from a property grid control, use these event handler macros to direct input to member functions that take a wx.propgrid.PropertyGridEvent argument.

events Events Emitted by this Class

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

  • EVT_PG_SELECTED : Respond to wxEVT_PG_SELECTED event, generated when a property selection has been changed, either by user action or by indirect program function. For instance, collapsing a parent property programmatically causes any selected child property to become unselected, and may therefore cause this event to be generated.

  • EVT_PG_CHANGED: Respond to wxEVT_PG_CHANGED event, generated when property value has been changed by the user.

  • EVT_PG_CHANGING: Respond to wxEVT_PG_CHANGING event, generated when property value is about to be changed by user. Use PropertyGridEvent.GetValue() to take a peek at the pending value, and wx.propgrid.PropertyGridEvent.Veto to prevent change from taking place, if necessary.

  • EVT_PG_HIGHLIGHTED: Respond to wxEVT_PG_HIGHLIGHTED event, which occurs when mouse moves over a property. Event’s property is None if hovered area does not belong to any property.

  • EVT_PG_RIGHT_CLICK: Respond to wxEVT_PG_RIGHT_CLICK event, which occurs when property is clicked on with right mouse button.

  • EVT_PG_DOUBLE_CLICK: Respond to wxEVT_PG_DOUBLE_CLICK event, which occurs when property is double-clicked on with left mouse button.

  • EVT_PG_ITEM_COLLAPSED: Respond to wxEVT_PG_ITEM_COLLAPSED event, generated when user collapses a property or category.

  • EVT_PG_ITEM_EXPANDED: Respond to wxEVT_PG_ITEM_EXPANDED event, generated when user expands a property or category.

  • EVT_PG_LABEL_EDIT_BEGIN: Respond to wxEVT_PG_LABEL_EDIT_BEGIN event, generated when user is about to begin editing a property label. You can veto this event to prevent the action.

  • EVT_PG_LABEL_EDIT_ENDING: Respond to wxEVT_PG_LABEL_EDIT_ENDING event, generated when user is about to end editing of a property label. You can veto this event to prevent the action.

  • EVT_PG_COL_BEGIN_DRAG: Respond to wxEVT_PG_COL_BEGIN_DRAG event, generated when user starts resizing a column - can be vetoed.

  • EVT_PG_COL_DRAGGING, : Respond to wxEVT_PG_COL_DRAGGING , event, generated when a column resize by user is in progress. This event is also generated when user double-clicks the splitter in order to recenter it.

  • EVT_PG_COL_END_DRAG: Respond to wxEVT_PG_COL_END_DRAG event, generated after column resize by user has finished.


class_hierarchy Class Hierarchy

Inheritance diagram for class PropertyGridEvent:

method_summary Methods Summary

__init__

Constructor.

CanVeto

Returns True if you can veto the action that the event is signaling.

GetColumn

Returns the column index associated with this event.

GetMainParent

Returns highest level non-category, non-root parent of property for which event occurred.

GetProperty

Returns property associated with this event.

GetPropertyName

Returns name of the associated property.

GetPropertyValue

Returns value of the associated property.

GetValidationFailureBehavior

Returns current validation failure flags.

SetCanVeto

Set if event can be vetoed.

SetProperty

Changes the property associated with this event.

SetValidationFailureBehavior

Set override validation failure behaviour.

SetValidationFailureMessage

Sets custom failure message for this time only.

Veto

Call this from your event handler to veto action that the event is signaling.

WasVetoed

Returns True if event was vetoed.


api Class API

class wx.propgrid.PropertyGridEvent(CommandEvent)

Possible constructors:

PropertyGridEvent(commandType=0, id=0)

PropertyGridEvent(event)

A property grid event holds information about events associated with PropertyGrid objects.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



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

Constructor.

Parameters
  • commandType (wx.EventType) –

  • id (int) –



__init__ (self, event)

Copy constructor.

Parameters

event (wx.propgrid.PropertyGridEvent) –





CanVeto(self)

Returns True if you can veto the action that the event is signaling.

Return type

bool



GetColumn(self)

Returns the column index associated with this event.

For the column dragging events, it is the column to the left of the splitter being dragged

Return type

int



GetMainParent(self)

Returns highest level non-category, non-root parent of property for which event occurred.

Useful when you have nested properties with children.

Return type

wx.propgrid.PGProperty

Note

If immediate parent is root or category, this will return the property itself.



GetProperty(self)

Returns property associated with this event.

Return type

wx.propgrid.PGProperty

Note

You should assume that this property can always be None. For instance, wxEVT_PG_SELECTED is emitted not only when a new property is selected, but also when selection is cleared by user activity.



GetPropertyName(self)

Returns name of the associated property.

Return type

string

Note

Property name is stored in event, so it remains accessible even after the associated property or the property grid has been deleted.



GetPropertyValue(self)

Returns value of the associated property.

Works for all event types, but for wxEVT_PG_CHANGING this member function returns the value that is pending, so you can call Veto if the value is not satisfactory.

Return type

PGVariant

Note

Property value is stored in event, so it remains accessible even after the associated property or the property grid has been deleted. Returns value of the associated property.

See also

GetPropertyValue



GetValidationFailureBehavior(self)

Returns current validation failure flags.

Return type

wx.byte



SetCanVeto(self, canVeto)

Set if event can be vetoed.

Parameters

canVeto (bool) –



SetProperty(self, p)

Changes the property associated with this event.

Parameters

p (wx.propgrid.PGProperty) –



SetValidationFailureBehavior(self, flags)

Set override validation failure behaviour.

Only effective if Veto was also called, and only allowed if event type is wxEVT_PG_CHANGING .

Parameters

flags (wx.byte) –



SetValidationFailureMessage(self, message)

Sets custom failure message for this time only.

Only applies if PG_VFB_SHOW_MESSAGE is set in validation failure flags.

Parameters

message (string) –



Veto(self, veto=True)

Call this from your event handler to veto action that the event is signaling.

You can only veto a shutdown if wx.propgrid.PropertyGridEvent.CanVeto returns True.

Parameters

veto (bool) –

Note

Currently only wxEVT_PG_CHANGING supports vetoing.



WasVetoed(self)

Returns True if event was vetoed.

Return type

bool


Properties

Column

See GetColumn



MainParent

See GetMainParent



Property

See GetProperty and SetProperty



PropertyName

See GetPropertyName



PropertyValue

See GetPropertyValue



ValidationFailureBehavior

See GetValidationFailureBehavior and SetValidationFailureBehavior