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 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 wx.propgrid.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¶
Inheritance diagram for class PropertyGridEvent:

Methods Summary¶Constructor. |
|
Returns |
|
Returns the column index associated with this event. |
|
Returns highest level non-category, non-root parent of property for which event occurred. |
|
Returns property associated with this event. |
|
Returns name of the associated property. |
|
Returns value of the associated property. |
|
Returns current validation failure flags. |
|
Returns value of the associated property. |
|
Set if event can be vetoed. |
|
Changes the property associated with this event. |
|
Set override validation failure behaviour. |
|
Sets custom failure message for this time only. |
|
Call this from your event handler to veto action that the event is signaling. |
|
Returns |
Properties Summary¶See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶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.
__init__(self, *args, **kw)¶__init__ (self, commandType=0, id=0)
Constructor.
commandType (wx.EventType) –
id (int) –
__init__ (self, event)
Copy constructor.
event (wx.propgrid.PropertyGridEvent) –
CanVeto(self)¶Returns True if you can veto the action that the event is signaling.
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
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.
Note
If immediate parent is root or category, this will return the property itself.
GetProperty(self)¶Returns property associated with this event.
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.
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.
PGVariant
Note
Property value is stored in event, so it remains accessible even after the associated property or the property grid has been deleted.
GetValidationFailureBehavior(self)¶Returns current validation failure flags.
wx.byte
GetValue(self)¶Returns value of the associated property.
PGVariant
See also
SetCanVeto(self, canVeto)¶Set if event can be vetoed.
canVeto (bool) –
SetProperty(self, p)¶Changes the property associated with this event.
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 .
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.
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.
veto (bool) –
Note
Currently only wxEVT_PG_CHANGING supports vetoing.
WasVetoed(self)¶Returns True if event was vetoed.
bool
MainParent¶See GetMainParent
Property¶See GetProperty and SetProperty
PropertyName¶See GetPropertyName
PropertyValue¶See GetPropertyValue
ValidationFailureBehavior¶See GetValidationFailureBehavior and SetValidationFailureBehavior