#include <props.h>
Public Member Functions | |
virtual wxValidator * | DoGetValidator () const |
Returns pointer to the wxValidator that should be used with the editor of this property (NULL for no validator). | |
virtual wxString | GetValueAsString (int argFlags=0) const |
Returns text representation of property's value. | |
virtual bool | IntToValue (wxVariant &variant, int number, int argFlags=0) const |
Converts 'number' (including choice selection) into proper value 'variant'. | |
virtual bool | StringToValue (wxVariant &variant, const wxString &text, int argFlags=0) const |
Converts 'text' into proper value 'variant'. | |
virtual bool | ValidateValue (wxVariant &value, wxPGValidationInfo &validationInfo) const |
Implement this function in derived class to check the value. | |
wxIntProperty (const wxString &label, const wxString &name, const wxLongLong &value) | |
wxIntProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, long value=0) | |
Static Public Member Functions | |
static bool | DoValidation (const wxPGProperty *property, wxLongLong_t &value, wxPGValidationInfo *pValidationInfo, int mode=wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE) |
Validation helper. | |
static wxValidator * | GetClassValidator () |
Seamlessly supports 64-bit integer (wxLongLong) on overflow.
Example how to use seamless 64-bit integer support
Getting value:
wxLongLong_t value = pg->GetPropertyValueAsLongLong();
or
wxLongLong_t value; wxVariant variant = property->GetValue(); if ( variant.GetType() == wxT("wxLongLong") ) value = wxLongLongFromVariant(variant); else value = variant.GetLong();
Setting value:
pg->SetPropertyValue(longLongVal);
or
property->SetValue(WXVARIANT(longLongVal));
Supported special attributes:
virtual wxValidator* wxIntProperty::DoGetValidator | ( | ) | const [virtual] |
Returns pointer to the wxValidator that should be used with the editor of this property (NULL 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):
wxValidator* wxMyPropertyClass::DoGetValidator () const { WX_PG_DOGETVALIDATOR_ENTRY() wxMyValidator* validator = new wxMyValidator(...); ... prepare validator... WX_PG_DOGETVALIDATOR_EXIT(validator) }
Reimplemented from wxPGProperty.
virtual wxString wxIntProperty::GetValueAsString | ( | int | argFlags = 0 |
) | const [virtual] |
Returns text representation of property's value.
Generally this function should not be called from the application code. Instead, call GetValueString().
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable string value instead of displayable. If wxPG_EDITABLE_VALUE is set, returns string value that must be editable in textctrl. If wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to display as a part of composite property string value. |
Reimplemented from wxPGProperty.
virtual bool wxIntProperty::IntToValue | ( | wxVariant & | value, | |
int | number, | |||
int | argFlags = 0 | |||
) | const [virtual] |
Converts 'number' (including choice selection) into proper value 'variant'.
Returns true if new (different than m_value) value could be interpreted from the integer.
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable |
Reimplemented from wxPGProperty.
virtual bool wxIntProperty::StringToValue | ( | wxVariant & | variant, | |
const wxString & | text, | |||
int | argFlags = 0 | |||
) | const [virtual] |
Converts 'text' into proper value 'variant'.
Returns true if new (different than m_value) value could be interpreted from the text.
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by GetValueAsString() called with this same flag). |
Reimplemented from wxPGProperty.
virtual bool wxIntProperty::ValidateValue | ( | wxVariant & | value, | |
wxPGValidationInfo & | validationInfo | |||
) | const [virtual] |
Implement this function in derived class to check the value.
Return true if it is ok. Returning false prevents property change events from occurring.
Reimplemented from wxPGProperty.