X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0372d42ea50de251b381c22855b372a967bc04d9..2d770c4f8204938933914a961d4142f97ec12f50:/samples/propgrid/sampleprops.h diff --git a/samples/propgrid/sampleprops.h b/samples/propgrid/sampleprops.h index 6d7166901a..0fbbf446b7 100644 --- a/samples/propgrid/sampleprops.h +++ b/samples/propgrid/sampleprops.h @@ -4,14 +4,15 @@ // Author: Jaakko Salli // Modified by: // Created: 2006-03-05 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) Jaakko Salli -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SAMPLES_PROPGRID_SAMPLEPROPS_H_ #define _WX_SAMPLES_PROPGRID_SAMPLEPROPS_H_ +#include "wx/fontdata.h" DECLARE_VARIANT_OBJECT(wxFontData) @@ -28,14 +29,17 @@ public: void OnSetValue(); - // Inorder to have different value type in a derived property + // In order to have different value type in a derived property // class, we will override GetValue to return custom variant, // instead of changing the base m_value. This allows the methods // in base class to function properly. virtual wxVariant DoGetValue() const; - WX_PG_DECLARE_PARENTAL_METHODS() - WX_PG_DECLARE_EVENT_METHODS() + virtual wxVariant 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,7 +58,10 @@ public: const wxSize& value = wxSize() ); virtual ~wxSizeProperty(); - WX_PG_DECLARE_PARENTAL_METHODS() + virtual wxVariant ChildChanged( wxVariant& thisValue, + int childIndex, + wxVariant& childValue ) const; + virtual void RefreshChildren(); protected: @@ -76,7 +83,10 @@ public: const wxPoint& value = wxPoint() ); virtual ~wxPointProperty(); - WX_PG_DECLARE_PARENTAL_METHODS() + virtual wxVariant ChildChanged( wxVariant& thisValue, + int childIndex, + wxVariant& childValue ) const; + virtual void RefreshChildren(); protected: @@ -107,9 +117,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;