]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/propgrid/sampleprops.h
Document ctors creating a wxString from repeated characters.
[wxWidgets.git] / samples / propgrid / sampleprops.h
index f363fdfc5157ae8eca3b4ce1d5f2094212abd26b..963eade80f9aeaeac327808c35736c86e14b5632 100644 (file)
@@ -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,11 @@ public:
     // 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,14 +57,17 @@ 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:
 
     // I stands for internal
     void SetValueI( const wxSize& value )
     {
-        m_value = wxSizeToVariant(value);
+        m_value = WXVARIANT(value);
     }
 };
 
@@ -76,14 +82,17 @@ 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:
 
     // I stands for internal
     void SetValueI( const wxPoint& value )
     {
-        m_value = wxPointToVariant(value);
+        m_value = WXVARIANT(value);
     }
 };
 
@@ -93,7 +102,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 +116,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;