Basic property with integer value.
__init__ |
|
DoGetValidator |
Returns pointer to the wx.Validator that should be used with the editor of this property (None for no validator). |
DoValidation |
Validation helper. |
GetClassValidator |
|
IntToValue |
Converts integer (possibly a choice selection) into Variant value appropriate for this property. |
StringToValue |
Converts text into Variant value appropriate for this property. |
ValidateValue |
Implement this function in derived class to check the value. |
ValueToString |
Converts property value into a text representation. |
wx.propgrid.
IntProperty
(PGProperty)¶Possible constructors:
IntProperty(label=PG_LABEL, name=PG_LABEL, value=0)
IntProperty(label, name, value)
Basic property with integer value.
__init__
(self, *args, **kw)¶__init__ (self, label=PG_LABEL, name=PG_LABEL, value=0)
Parameters: |
|
---|
__init__ (self, label, name, value)
Parameters: |
|
---|
DoGetValidator
(self)¶Returns pointer to the wx.Validator that should be used with the editor of this property (None
for no validator).
Setting validator explicitly via SetPropertyValidator will override this.
In most situations, code like this should work well (macros are used to maintain one actual validator instance, so on the second call the function exits within the first macro):
class MyPropertyClass(wx.propgrid.IntProperty):
...
def DoGetValidator(self):
validator = MyValidator(...)
... prepare validator...
return validator
Return type: | Validator |
---|
Note
You can get common filename validator by returning wx.propgrid.FileProperty.GetClassValidator
. wx.propgrid.DirProperty, for example, uses it.
DoValidation
(property, value, pValidationInfo, mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE)¶Validation helper.
Parameters: |
|
---|---|
Return type: | bool |
GetClassValidator
()¶Return type: | Validator |
---|
IntToValue
(self, variant, number, argFlags=0)¶Converts integer (possibly a choice selection) into Variant value appropriate for this property.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | Returns |
Note
StringToValue
(self, variant, text, argFlags=0)¶Converts text into Variant value appropriate for this property.
Parameters: |
|
---|---|
Return type: | bool |
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
True
.ValueToString
(self, value, argFlags=0)¶Converts property value into a text representation.
Parameters: |
|
---|---|
Return type: |
|
Note
Default implementation calls GenerateComposedValue
.