wx.propgrid.EditEnumProperty¶
wx.propgrid.EnumProperty with String value and writable combo box editor.
Note
Uses int value, similar to wx.propgrid.EnumProperty, unless text entered by user is not in choices (in which case string value is used).
Class Hierarchy¶
Methods Summary¶
This virtual function is called after m_value has been set. |
|
Converts text into Variant value appropriate for this property. |
|
Implement this function in derived class to check the value. |
Class API¶
- class wx.propgrid.EditEnumProperty(EnumProperty)¶
Possible constructors:
EditEnumProperty(label=PG_LABEL, name=PG_LABEL, labels=[], values=[], value="") -> None EditEnumProperty(label, name, choices, value="") -> None
EnumProperty with string value and writable combo box editor.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, label=PG_LABEL, name=PG_LABEL, labels=[], values=[], value=””)
- Parameters:
label (string)
name (string)
labels (list of strings)
values (list of integers)
value (string)
- Return type:
None
__init__ (self, label, name, choices, value=””)
- Parameters:
label (string)
name (string)
choices (wx.propgrid.PGChoices)
value (string)
- Return type:
None
- OnSetValue(self)¶
This virtual function is called after m_value has been set.
- Return type:
None
Note
If m_value was set to Null variant (i.e. unspecified value),
OnSetValuewill not be called.m_value may be of any variant type. Typically properties internally support only one variant type, and as such
OnSetValueprovides a good opportunity to convert supported values into internal type.Default implementation does nothing.
- StringToValue(self, text, flags=PGPropValFormatFlags.Null)¶
Converts text into Variant value appropriate for this property.
- Parameters:
text (string) – Text to be translated into variant.
flags (PGPropValFormatFlags) – If
wx.propgrid.PGPropValFormatFlags.FullValueis set, returns complete, storable value instead of displayable one (they may be different). Ifwx.propgrid.PGPropValFormatFlags.CompositeFragmentis set, text is interpreted as a part of composite property string value (as generated byValueToStringcalled with this same flag).
- Return type:
Tuple[bool, PGVariant]
You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).
- Returns:
Returns
Trueif resulting Variant value was different.
Note
Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
- ValidateValue(self, value, validationInfo)¶
Implement this function in derived class to check the value.
Return
Trueif it is ok. ReturningFalseprevents property change events from occurring.- Parameters:
value (PGVariant)
validationInfo (wx.propgrid.PGValidationInfo)
- Return type:
bool
Note
Default implementation always returns
True.
