wxIntProperty Class Reference

Basic property with integer value. Seamlessly supports 64-bit integer (wxLongLong) on overflow. More...

#include <props.h>

Inheritance diagram for wxIntProperty:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual wxValidator * DoGetValidator () const
virtual bool IntToValue (wxVariant &variant, int number, int argFlags=0) const
virtual bool ValidateValue (wxVariant &value, wxPGValidationInfo &validationInfo) const
 wxIntProperty (const wxString &label, const wxString &name, const wxLongLong &value)
 wxIntProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, long value=0)
virtual ~wxIntProperty ()

Static Public Member Functions

static bool DoValidation (const wxPGProperty *property, wxLongLong_t &value, wxPGValidationInfo *pValidationInfo, int mode=wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE)
static wxValidator * GetClassValidator ()

Detailed Description

Basic property with integer value. 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:

Definition at line 403 of file props.h.


Constructor & Destructor Documentation

wxIntProperty::wxIntProperty ( const wxString &  label = wxPG_LABEL,
const wxString &  name = wxPG_LABEL,
long  value = 0 
)
virtual wxIntProperty::~wxIntProperty (  )  [virtual]
wxIntProperty::wxIntProperty ( const wxString &  label,
const wxString &  name,
const wxLongLong &  value 
)

Member Function Documentation

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

Reimplemented from wxPGProperty.

static bool wxIntProperty::DoValidation ( const wxPGProperty property,
wxLongLong_t &  value,
wxPGValidationInfo pValidationInfo,
int  mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE 
) [static]

Validation helper.

static wxValidator* wxIntProperty::GetClassValidator (  )  [static]
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.

Parameters:
argFlags If 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 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.

Remarks:
  • Default implementation always returns true.

Reimplemented from wxPGProperty.


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


wxpropgrid
Author(s): Jaakko Salli
autogenerated on Fri Jan 11 09:34:06 2013