]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/property.h
Automatically adjust toolbar's tool size if the provided bitmaps
[wxWidgets.git] / include / wx / propgrid / property.h
index 7c329b7d1c4fca1d7980a27f773f37431cc0d586..fb4dc1cae2e07f337c5178212d04bcec591693c7 100644 (file)
@@ -737,6 +737,11 @@ private:
     Helper class for managing choices of wxPropertyGrid properties.
     Each entry can have label, value, bitmap, text colour, and background
     colour.
+    wxPGChoices uses reference counting, similar to other wxWidgets classes.
+    This means that assignment operator and copy constructor only copy the
+    reference and not the actual data. Use Copy() member function to create a
+    real copy.
 
     @remarks If you do not specify value for entry, index is used.
 
@@ -754,7 +759,10 @@ public:
         Init();
     }
 
-    /** Copy constructor. */
+    /**
+        Copy constructor, uses reference counting. To create a real copy,
+        use Copy() member function instead.
+    */
     wxPGChoices( const wxPGChoices& a )
     {
         if ( a.m_data != wxPGChoicesEmptyData )
@@ -853,6 +861,10 @@ public:
     wxPGChoiceEntry& AddAsSorted( const wxString& label,
                                   int value = wxPG_INVALID_VALUE );
 
+    /**
+        Assigns choices data, using reference counting. To create a real copy,
+        use Copy() member function instead.
+    */
     void Assign( const wxPGChoices& a )
     {
         AssignData(a.m_data);
@@ -867,6 +879,17 @@ public:
             m_data->Clear();
     }
 
+    /**
+        Returns a real copy of the choices.
+    */
+    wxPGChoices Copy() const
+    {
+        wxPGChoices dst;
+        dst.EnsureData();
+        dst.m_data->CopyDataFrom(m_data);
+        return dst;
+    }
+
     void EnsureData()
     {
         if ( m_data == wxPGChoicesEmptyData )
@@ -1423,6 +1446,15 @@ public:
     */
     virtual wxPGEditorDialogAdapter* GetEditorDialog() const;
 
+    /**
+        Called whenever validation has failed with given pending value.
+
+        @remarks If you implement this in your custom property class, please
+                 remember to call the baser implementation as well, since they
+                 may use it to revert property into pre-change state.
+    */
+    virtual void OnValidationFailure( wxVariant& pendingValue );
+
     /** Append a new choice to property's list of choices.
     */
     int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE )
@@ -1443,6 +1475,11 @@ public:
         return false;
     }
 
+    /**
+        Deletes children of the property.
+    */
+    void DeleteChildren();
+
     /**
         Removes entry from property's wxPGChoices and editor control (if it is
         active).
@@ -1545,8 +1582,6 @@ public:
     */
     wxDEPRECATED( wxString GetValueString( int argFlags = 0 ) const );
 
-    void UpdateControl( wxWindow* primary );
-
     /**
         Returns wxPGCell of given column.
     */
@@ -2073,9 +2108,6 @@ public:
     /** Returns index of given child property. */
     int Index( const wxPGProperty* p ) const;
 
-    /** Deletes all sub-properties. */
-    void Empty();
-
     // Puts correct indexes to children
     void FixIndicesOfChildren( unsigned int starthere = 0 );
 
@@ -2205,6 +2237,9 @@ protected:
 
     void DoSetName(const wxString& str) { m_name = str; }
 
+    /** Deletes all sub-properties. */
+    void Empty();
+
     void InitAfterAdded( wxPropertyGridPageState* pageState,
                          wxPropertyGrid* propgrid );