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 towxEVT_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. Usewx.propgrid.PropertyGridEvent.GetValue
to take a peek at the pending value, andwx.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 isNone
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 towxEVT_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¶
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¶
- class wx.propgrid.PropertyGridEvent(CommandEvent)¶
Possible constructors:
PropertyGridEvent(commandType=0, id=0) -> None PropertyGridEvent(event) -> None
A property grid event holds information about events associated with PropertyGrid objects.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, commandType=0, id=0)
Constructor.
- Parameters:
commandType (wx.EventType)
id (int)
- Return type:
None
__init__ (self, event)
Copy constructor.
- Parameters:
event (wx.propgrid.PropertyGridEvent)
- Return type:
None
- 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:
Note
If immediate parent is root or category, this will return the property itself.
- GetProperty(self)¶
Returns property associated with this event.
- Return type:
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:
str
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 callVeto
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.
- GetValidationFailureBehavior(self)¶
Returns current validation failure flags.
- Return type:
int
- GetValue(self)¶
Returns value of the associated property.
- Return type:
PGVariant
See also
- SetCanVeto(self, canVeto)¶
Set if event can be vetoed.
- Parameters:
canVeto (bool)
- Return type:
None
- SetProperty(self, p)¶
Changes the property associated with this event.
- Parameters:
- Return type:
None
- SetValidationFailureBehavior(self, flags)¶
Set override validation failure behaviour.
Only effective if
Veto
was also called, and only allowed if event type iswxEVT_PG_CHANGING
.- Parameters:
flags (wx.byte)
- Return type:
None
- 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)
- Return type:
None
- 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
returnsTrue
.- Parameters:
veto (bool)
- Return type:
None
Note
Currently only
wxEVT_PG_CHANGING
supports vetoing.
- WasVetoed(self)¶
Returns
True
if event was vetoed.- Return type:
bool
Properties¶
- MainParent¶
See
GetMainParent
- Property¶
See
GetProperty
andSetProperty
- PropertyName¶
See
GetPropertyName
- PropertyValue¶
See
GetPropertyValue
- ValidationFailureBehavior¶
See
GetValidationFailureBehavior
andSetValidationFailureBehavior