wxPropertyGrid
Public Member Functions | Protected Attributes
wxUIntProperty Class Reference

Basic property with unsigned integer value. More...

#include <props.h>

Inheritance diagram for wxUIntProperty:
wxPGProperty

List of all members.

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 bool DoSetAttribute (const wxString &name, wxVariant &value)
 Special handling for attributes of this property.
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.
 wxUIntProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, unsigned long value=0)
 wxUIntProperty (const wxString &label, const wxString &name, const wxULongLong &value)

Protected Attributes

wxByte m_base
wxByte m_prefix
wxByte m_realBase

Detailed Description

Basic property with unsigned integer value.

Seamlessly supports 64-bit integer (wxULongLong) on overflow.

Supported special attributes:

Remarks:
  • For example how to use seamless 64-bit integer support, see wxIntProperty documentation (just use wxULongLong instead of wxLongLong).

Member Function Documentation

virtual wxValidator* wxUIntProperty::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)
        }
Remarks:
You can get common filename validator by returning wxFileProperty::GetClassValidator(). wxDirProperty, for example, uses it.

Reimplemented from wxPGProperty.

virtual bool wxUIntProperty::DoSetAttribute ( const wxString &  name,
wxVariant &  value 
) [virtual]

Special handling for attributes of this property.

If returns false, then the attribute will be automatically stored in m_attributes.

Default implementation simply returns false.

Reimplemented from wxPGProperty.

virtual wxString wxUIntProperty::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().

Parameters:
argFlagsIf 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.
Remarks:
  • Default implementation returns string composed from text representations of child properties.
  • Implementations are never called with m_value being null variant (ie. unspecified value), so you don't need to check for that. Naturally this means that unspecified value is always displayed as an empty string.
See also:
GetValueString()

Reimplemented from wxPGProperty.

virtual bool wxUIntProperty::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.

Parameters:
argFlagsIf wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable
Remarks:
  • Default implementation may work correctly if used value type is int.
  • If property is not supposed to use choice or spinctrl or other editor with int-based value, it is not necessary to implement this method.
  • If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent.
  • 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 behavior).

Reimplemented from wxPGProperty.

virtual bool wxUIntProperty::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.

Parameters:
argFlagsIf 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).
Remarks:
  • Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
  • 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 behavior).

Reimplemented from wxPGProperty.

virtual bool wxUIntProperty::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.

Remarks:
  • Default implementation always returns true.

Reimplemented from wxPGProperty.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator