wx.propgrid.PGChoiceEditor¶
Class Hierarchy¶
Known Subclasses¶
wx.propgrid.PGChoiceAndButtonEditor, wx.propgrid.PGComboBoxEditor
Methods Summary¶
Returns |
|
Instantiates editor controls. |
|
Deletes item from existing control. |
|
Returns pointer to the name of the editor. |
|
Returns value from control, via parameter variant. |
|
Inserts item to existing control. |
|
Handles events. |
|
Sets control’s value specifically from int (applies to choice etc.). |
|
Sets control’s value specifically from string. |
|
Sets value in control to unspecified. |
|
Loads value from property to the control. |
Properties Summary¶
See |
Class API¶
- class wx.propgrid.PGChoiceEditor(PGEditor)¶
Possible constructors:
PGChoiceEditor() -> None
Methods¶
- __init__(self)¶
- Return type:
None
- CanContainCustomImage(self)¶
Returns
True
if control itself can contain the custom image.Default implementation returns
False
.- Return type:
bool
- CreateControls(self, propgrid, property, pos, size)¶
Instantiates editor controls.
- Parameters:
propgrid (wx.propgrid.PropertyGrid) – wx.propgrid.PropertyGrid to which the property belongs (use as parent for control).
property (wx.propgrid.PGProperty) – Property for which this method is called.
pos (wx.Point) – Position, inside wx.propgrid.PropertyGrid, to create control(s) to.
size (wx.Size) – Initial size for control(s).
- Return type:
Note
It is not necessary to call
wx.EvtHandler.Bind
for interesting editor events. All events from controls are automatically forwarded towx.propgrid.PGEditor.OnEvent
andwx.propgrid.PGProperty.OnEvent
.
- CreateControlsBase(self, propgrid, property, pos, sz, extraStyle)¶
- Parameters:
propgrid (wx.propgrid.PropertyGrid)
property (wx.propgrid.PGProperty)
pos (wx.Point)
sz (wx.Size)
extraStyle (long)
- Return type:
Window
- DeleteItem(self, ctrl, index)¶
Deletes item from existing control.
Default implementation does nothing.
- Parameters:
ctrl (wx.Window)
index (int)
- Return type:
None
- GetName(self)¶
Returns pointer to the name of the editor.
For example, PGEditor_TextCtrl has name “TextCtrl”. If you don’t need to access your custom editor by string name, then you do not need to implement this function.
- Return type:
str
- GetValueFromControl(self, variant, property, ctrl)¶
Returns value from control, via parameter variant.
Usually ends up calling property’s StringToValue() or IntToValue(). Returns
True
if value was different.- Parameters:
variant (PGVariant)
property (wx.propgrid.PGProperty)
ctrl (wx.Window)
- Return type:
bool
- InsertItem(self, ctrl, label, index)¶
Inserts item to existing control.
Index -1 means end of list. Default implementation does nothing. Returns index of item added.
- Parameters:
ctrl (wx.Window)
label (string)
index (int)
- Return type:
int
- OnEvent(self, propgrid, property, wnd_primary, event)¶
Handles events.
Returns
True
if value in control was modified (seewx.propgrid.PGProperty.OnEvent
for more information).- Parameters:
propgrid (wx.propgrid.PropertyGrid)
property (wx.propgrid.PGProperty)
wnd_primary (wx.Window)
event (wx.Event)
- Return type:
bool
Note
wx.propgrid.PropertyGrid will automatically unfocus the editor when
wxEVT_TEXT_ENTER
is received and when it results in property value being modified. This happens regardless of editor type (i.e. behaviour is same for any wx.TextCtrl and wx.ComboBox based editor).
- SetControlIntValue(self, property, ctrl, value)¶
Sets control’s value specifically from int (applies to choice etc.).
- Parameters:
property (wx.propgrid.PGProperty)
ctrl (wx.Window)
value (int)
- Return type:
None
- SetControlStringValue(self, property, ctrl, txt)¶
Sets control’s value specifically from string.
- Parameters:
property (wx.propgrid.PGProperty)
ctrl (wx.Window)
txt (string)
- Return type:
None
- SetValueToUnspecified(self, property, ctrl)¶
Sets value in control to unspecified.
- Parameters:
property (wx.propgrid.PGProperty)
ctrl (wx.Window)
- Return type:
None
- UpdateControl(self, property, ctrl)¶
Loads value from property to the control.
- Parameters:
property (wx.propgrid.PGProperty)
ctrl (wx.Window)
- Return type:
None
Properties¶