X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c4293cb91327247ad69e6ec8d589bfaa299db28..e6f1eb562251df2e20ae28f3bde4668ddc5bed16:/samples/propgrid/sampleprops.h diff --git a/samples/propgrid/sampleprops.h b/samples/propgrid/sampleprops.h index f363fdfc51..3399ec8db8 100644 --- a/samples/propgrid/sampleprops.h +++ b/samples/propgrid/sampleprops.h @@ -4,7 +4,7 @@ // Author: Jaakko Salli // Modified by: // Created: 2006-03-05 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -13,7 +13,7 @@ #define _WX_SAMPLES_PROPGRID_SAMPLEPROPS_H_ -WX_PG_DECLARE_WXOBJECT_VARIANT_DATA(wxPGVariantDataFontData, wxFontData, wxEMPTY_PARAMETER_VALUE) +DECLARE_VARIANT_OBJECT(wxFontData) class wxFontDataProperty : public wxFontProperty @@ -34,8 +34,10 @@ public: // in base class to function properly. virtual wxVariant DoGetValue() const; - WX_PG_DECLARE_PARENTAL_METHODS() - WX_PG_DECLARE_EVENT_METHODS() + virtual void ChildChanged( wxVariant& thisValue, + int childIndex, wxVariant& childValue ) const; + virtual void RefreshChildren(); + virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); protected: // Value must be stored as variant - otherwise it will be @@ -54,14 +56,16 @@ public: const wxSize& value = wxSize() ); virtual ~wxSizeProperty(); - WX_PG_DECLARE_PARENTAL_METHODS() + virtual void ChildChanged( wxVariant& thisValue, + int childIndex, wxVariant& childValue ) const; + virtual void RefreshChildren(); protected: // I stands for internal void SetValueI( const wxSize& value ) { - m_value = wxSizeToVariant(value); + m_value = WXVARIANT(value); } }; @@ -76,14 +80,16 @@ public: const wxPoint& value = wxPoint() ); virtual ~wxPointProperty(); - WX_PG_DECLARE_PARENTAL_METHODS() + virtual void ChildChanged( wxVariant& thisValue, + int childIndex, wxVariant& childValue ) const; + virtual void RefreshChildren(); protected: // I stands for internal void SetValueI( const wxPoint& value ) { - m_value = wxPointToVariant(value); + m_value = WXVARIANT(value); } }; @@ -93,7 +99,7 @@ WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR_WITH_DECL(wxDirsProperty, clas // ----------------------------------------------------------------------- -WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataArrayDouble, wxArrayDouble, wxEMPTY_PARAMETER_VALUE) +WX_PG_DECLARE_VARIANT_DATA(wxArrayDouble) class wxArrayDoubleProperty : public wxPGProperty { @@ -107,9 +113,12 @@ public: virtual ~wxArrayDoubleProperty (); virtual void OnSetValue(); - WX_PG_DECLARE_BASIC_TYPE_METHODS() - WX_PG_DECLARE_EVENT_METHODS() - WX_PG_DECLARE_ATTRIBUTE_METHODS() + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; + virtual bool StringToValue( wxVariant& variant, + const wxString& text, + int argFlags = 0 ) const; + virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); + virtual bool DoSetAttribute( const wxString& name, wxVariant& value ); // Generates cache for displayed text virtual void GenerateValueAsString ( wxString& target, int prec, bool removeZeroes ) const;