]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/advprops.h
moving more things to common API between carbon and cocoa, adapting WidthDefault...
[wxWidgets.git] / include / wx / propgrid / advprops.h
index 29c5b615cfc42c51731417a67c2499bdf3a64f3d..5c6eb2eb17e191261b5ea8e680a4a408ccfb1d51 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Jaakko Salli
 // Modified by:
 // Created:     2004-09-25
-// RCS-ID:      $Id:
+// RCS-ID:      $Id$
 // Copyright:   (c) Jaakko Salli
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
@@ -12,6 +12,8 @@
 #ifndef _WX_PROPGRID_ADVPROPS_H_
 #define _WX_PROPGRID_ADVPROPS_H_
 
+#if wxUSE_PROPGRID
+
 #include "wx/propgrid/props.h"
 
 // -----------------------------------------------------------------------
@@ -82,6 +84,7 @@ public:
     wxColour    m_colour;
 
     wxColourPropertyValue()
+        : wxObject()
     {
         m_type = 0;
     }
@@ -91,6 +94,7 @@ public:
     }
 
     wxColourPropertyValue( const wxColourPropertyValue& v )
+        : wxObject()
     {
         m_type = v.m_type;
         m_colour = v.m_colour;
@@ -103,17 +107,20 @@ public:
     }
 
     wxColourPropertyValue( const wxColour& colour )
+        : wxObject()
     {
         m_type = wxPG_COLOUR_CUSTOM;
         m_colour = colour;
     }
 
     wxColourPropertyValue( wxUint32 type )
+        : wxObject()
     {
         m_type = type;
     }
 
     wxColourPropertyValue( wxUint32 type, const wxColour& colour )
+        : wxObject()
     {
         Init( type, colour );
     }
@@ -174,10 +181,11 @@ public:
     virtual ~wxFontProperty();
     virtual void OnSetValue();
     virtual wxString GetValueAsString( int argFlags = 0 ) const;
-
-    WX_PG_DECLARE_EVENT_METHODS()
-    WX_PG_DECLARE_PARENTAL_METHODS()
-    //WX_PG_DECLARE_CUSTOM_PAINT_METHODS()
+    virtual bool OnEvent( wxPropertyGrid* propgrid,
+                          wxWindow* primary, wxEvent& event );
+    virtual void ChildChanged( wxVariant& thisValue,
+                               int childIndex, wxVariant& childValue ) const;
+    virtual void RefreshChildren();
 
 protected:
 };
@@ -223,13 +231,16 @@ public:
     */
     virtual int GetCustomColourIndex() const;
 
-    WX_PG_DECLARE_BASIC_TYPE_METHODS()
-    WX_PG_DECLARE_EVENT_METHODS()
-    WX_PG_DECLARE_ATTRIBUTE_METHODS()
-
-    WX_PG_DECLARE_CUSTOM_PAINT_METHODS()
-    //virtual wxSize GetImageSize( int item ) const;
-    //virtual wxPGCellRenderer* GetCellRenderer( int column ) const;
+    virtual wxString GetValueAsString( 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 );
+    virtual wxSize OnMeasureImage( int item ) const;
+    virtual void OnCustomPaint( wxDC& dc,
+                                const wxRect& rect, wxPGPaintData& paintdata );
 
     // Helper function to show the colour dialog
     bool QueryColourFromUser( wxVariant& variant ) const;
@@ -292,9 +303,9 @@ class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty
                       int value = 0 );
     virtual ~wxCursorProperty();
 
-    WX_PG_DECLARE_CUSTOM_PAINT_METHODS()
-    //virtual wxSize GetImageSize( int item ) const;
-    //virtual wxPGCellRenderer* GetCellRenderer( int column ) const;
+    virtual wxSize OnMeasureImage( int item ) const;
+    virtual void OnCustomPaint( wxDC& dc,
+                                const wxRect& rect, wxPGPaintData& paintdata );
 };
 
 // -----------------------------------------------------------------------
@@ -319,7 +330,9 @@ public:
 
     virtual void OnSetValue();
 
-    WX_PG_DECLARE_CUSTOM_PAINT_METHODS()
+    virtual wxSize OnMeasureImage( int item ) const;
+    virtual void OnCustomPaint( wxDC& dc,
+                                const wxRect& rect, wxPGPaintData& paintdata );
 
 protected:
     wxBitmap*   m_pBitmap; // final thumbnail area
@@ -368,9 +381,8 @@ public:
     virtual bool StringToValue(wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0) const;
-    WX_PG_DECLARE_EVENT_METHODS()
-
-    virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo );
+    virtual bool OnEvent( wxPropertyGrid* propgrid,
+                          wxWindow* primary, wxEvent& event );
 
     wxArrayInt GetValueAsArrayInt() const
     {
@@ -386,8 +398,6 @@ protected:
 
     wxArrayString       m_valueAsStrings;  // Value as array of strings
 
-    wxPGChoices         m_choices;
-
     // Cache displayed text since generating it is relatively complicated.
     wxString            m_display;
 };
@@ -422,7 +432,7 @@ public:
                                const wxString& text,
                                int argFlags = 0) const;
 
-    WX_PG_DECLARE_ATTRIBUTE_METHODS()
+    virtual bool DoSetAttribute( const wxString& name, wxVariant& value );
 
     void SetFormat( const wxString& format )
     {
@@ -507,4 +517,6 @@ private:
 
 // -----------------------------------------------------------------------
 
+#endif // wxUSE_PROPGRID
+
 #endif // _WX_PROPGRID_ADVPROPS_H_