Basic property with integer value.
Seamlessly supports 64-bit integer (ULongLong ) on overflow.
Supported special attributes:
wx.propgrid.PG_BASE_OCT
, wx.propgrid.PG_BASE_DEC
, wx.propgrid.PG_BASE_HEX
and wx.propgrid.PG_BASE_HEXL
(lowercase characters). Arbitrary bases are not supported.wx.propgrid.PG_PREFIX_NONE
, PG_PREFIX_0x, and wx.propgrid.PG_PREFIX_DOLLAR_SIGN
. Only wx.propgrid.PG_PREFIX_NONE
works with Decimal and Octal numbers.Note
__init__ |
|
DoGetValidator |
Returns pointer to the wx.Validator that should be used with the editor of this property (None for no validator). |
DoSetAttribute |
Reimplement this member function to add special handling for attributes of this property. |
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.
UIntProperty
(PGProperty)¶Possible constructors:
UIntProperty(label=PG_LABEL, name=PG_LABEL, value=0)
UIntProperty(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.UIntProperty):
...
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.
DoSetAttribute
(self, name, value)¶Reimplement this member function to add special handling for attributes of this property.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | Return |
Note
To actually set property attribute values from the application, use wx.propgrid.PGProperty.SetAttribute
instead.
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
.