X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91c818f82929ee2164ac5cfc77eaecddcea937a0..74c34d22773e39b13fe0502798494b38f261a9e5:/include/wx/propgrid/property.h diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 38019dfe9b..fb4dc1cae2 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -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 ) @@ -1550,8 +1582,6 @@ public: */ wxDEPRECATED( wxString GetValueString( int argFlags = 0 ) const ); - void UpdateControl( wxWindow* primary ); - /** Returns wxPGCell of given column. */