Eliminated C++ RTTI (typeid etc) use. Eliminated wxPGVariantData (default default value for new types is now Null variant). Re-created variantdata creator macros based on those found in variant.h. Using DECLARE/IMPLEMENT_VARIANT_OBJECT whenever possible.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-09-16 15:55:53 +00:00
parent e8443ddaa5
commit 0372d42ea5
17 changed files with 495 additions and 559 deletions

View File

@@ -406,18 +406,22 @@ struct wxPGChoiceInfo
they are only really needed if you need to use wxRTTI with your
property class.
You can change the 'value type' of a property by simply assigning different type
of variant with SetValue. <b>It is mandatory to implement wxVariantData class
for all data types used as property values.</b> Also, it is further recommended
to derive your class from wxPGVariantData, like this:
You can change the 'value type' of a property by simply assigning different
type of variant with SetValue. <b>It is mandatory to implement
wxVariantData class for all data types used as property values.</b>
You can use macros declared in wxPropertyGrid headers. For instance:
@code
// In header file:
// (replace DECL with required data declaration, wxEMPTY_PARAMETER_VALUE if none)
WX_PG_DECLARE_VARIANT_DATA(wxPGVariantMyDataClass, MyDataClass, DECL)
// (If you need to have export declaration, use version of macros
// with _EXPORTED postfix)
WX_PG_DECLARE_VARIANT_DATA(MyDataClass)
// In sources file:
WX_PG_IMPLEMENT_VARIANT_DATA(wxPGVariantMyDataClass, MyDataClass)
WX_PG_IMPLEMENT_VARIANT_DATA(MyDataClass)
// Or, if you don't have valid == operator:
WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(MyDataClass)
@endcode
@library{wxpropgrid}

View File

@@ -350,8 +350,7 @@ public:
return p->GetValidator();
}
/** Returns value as wxVariant. To get wxObject pointer from it,
you will have to use WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) macro.
/** Returns value as wxVariant.
If property value is unspecified, Null variant is returned.
*/
@@ -370,7 +369,6 @@ public:
int GetPropertyValueAsInt( wxPGPropArg id ) const { return (int)GetPropertyValueAsLong(id); }
bool GetPropertyValueAsBool( wxPGPropArg id ) const;
double GetPropertyValueAsDouble( wxPGPropArg id ) const;
wxObject* GetPropertyValueAsWxObjectPtr( wxPGPropArg id ) const;
void* GetPropertyValueAsVoidPtr( wxPGPropArg id ) const;
wxArrayString GetPropertyValueAsArrayString( wxPGPropArg id ) const