phoenix_title 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 Class Hierarchy

Inheritance diagram for class EditEnumProperty:

method_summary Methods Summary

__init__

OnSetValue

This virtual function is called after m_value has been set.

StringToValue

Converts text into Variant value appropriate for this property.

ValidateValue

Implement this function in derived class to check the value.


api 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)

overload Overloaded Implementations:



__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:
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), OnSetValue will not be called.

  • m_value may be of any variant type. Typically properties internally support only one variant type, and as such OnSetValue provides 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.FullValue is set, returns complete, storable value instead of displayable one (they may be different). If wx.propgrid.PGPropValFormatFlags.CompositeFragment is set, text is interpreted as a part of composite property string value (as generated by ValueToString called 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 True if 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 True if it is ok. Returning False prevents property change events from occurring.

Parameters:
Return type:

bool

Note

  • Default implementation always returns True.