X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c4293cb91327247ad69e6ec8d589bfaa299db28..25f49256ac6682a358e461036ec64aad1b26e353:/include/wx/propgrid/propgridpagestate.h diff --git a/include/wx/propgrid/propgridpagestate.h b/include/wx/propgrid/propgridpagestate.h index 5ff8ab5f57..5e58483f1f 100644 --- a/include/wx/propgrid/propgridpagestate.h +++ b/include/wx/propgrid/propgridpagestate.h @@ -4,7 +4,7 @@ // Author: Jaakko Salli // Modified by: // Created: 2008-08-24 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -12,6 +12,8 @@ #ifndef _WX_PROPGRID_PROPGRIDPAGESTATE_H_ #define _WX_PROPGRID_PROPGRIDPAGESTATE_H_ +#if wxUSE_PROPGRID + #include "wx/propgrid/property.h" // ----------------------------------------------------------------------- @@ -232,7 +234,8 @@ private: } \ const CLASS& operator=( const CLASS& it ) \ { \ - Assign(it); \ + if (this != &it) \ + Assign(it); \ return *this; \ } \ CLASS& operator++() { Next(); return *this; } \ @@ -287,6 +290,23 @@ public: const wxPGProperty, const wxPropertyGridPageState) + /** + Additional copy constructor. + */ + wxPropertyGridConstIterator( const wxPropertyGridIterator& other ) + { + Assign(other); + } + + /** + Additional assignment operator. + */ + const wxPropertyGridConstIterator& operator=( const wxPropertyGridIterator& it ) + { + Assign(it); + return *this; + } + protected: }; @@ -340,9 +360,12 @@ public: #ifndef SWIG const wxPGVIterator& operator=( const wxPGVIterator& it ) { - UnRef(); - m_pIt = it.m_pIt; - m_pIt->IncRef(); + if (this != &it) + { + UnRef(); + m_pIt = it.m_pIt; + m_pIt->IncRef(); + } return *this; } #endif @@ -398,7 +421,7 @@ public: Override this member function to add custom behavior on property deletion. */ - virtual void DoDelete( wxPGProperty* item ); + virtual void DoDelete( wxPGProperty* item, bool doDelete = true ); wxSize DoFitColumns( bool allowGridResize = false ); @@ -461,7 +484,7 @@ public: unsigned int GetColumnCount() const { - return m_colWidths.size(); + return (unsigned int) m_colWidths.size(); } wxPGProperty* GetSelection() const @@ -500,6 +523,8 @@ public: wxPGProperty* DoGetRoot() const { return m_properties; } + void DoSetPropertyName( wxPGProperty* p, const wxString& newName ); + // Returns combined width of margin and all the columns int GetVirtualWidth() const { @@ -517,24 +542,13 @@ public: unsigned int col, bool subProps) const; - /** Returns information about arbitrary position in the grid. - - wxPropertyGridHitTestResult definition: - @code - struct wxPropertyGridHitTestResult - { - wxPGProperty* GetProperty() const; - - // column. -1 for margin - int column; - - // Index of splitter hit, -1 for none. - int splitter; + /** + Returns information about arbitrary position in the grid. - // If splitter hit, then offset to that. - int splitterHitOffset; - }; - @endcode + @param pt + Logical coordinates in the virtual grid space. Use + wxScrolledWindow::CalcUnscrolledPosition() if you need to + translate a scrolled position into a logical one. */ wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const; @@ -544,9 +558,6 @@ public: bool IsInNonCatMode() const { return (bool)(m_properties == m_abcArray); } - /** Only inits arrays, doesn't migrate things or such. */ - void InitNonCatMode (); - void DoLimitPropertyEditing( wxPGProperty* p, bool limit = true ) { p->SetFlagRecursively(wxPG_PROP_NOEDITOR, limit); @@ -581,15 +592,15 @@ public: void DoSetPropertyValues( const wxVariantList& list, wxPGProperty* default_category ); - void DoSetPropertyValueUnspecified( wxPGProperty* p ); - void SetSplitterLeft( bool subProps = false ); /** Set virtual width for this particular page. */ void SetVirtualWidth( int width ); - void SortChildren( wxPGProperty* p ); - void Sort(); + void DoSortChildren( wxPGProperty* p, int flags = 0 ); + void DoSort( int flags = 0 ); + + bool PrepareAfterItemsAdded(); void SetSelection( wxPGProperty* p ) { m_selected = p; } @@ -632,7 +643,7 @@ protected: */ int HitTestH( int x, int* pSplitterHit, int* pSplitterHitOffset ) const; - int PrepareToAddItem ( wxPGProperty* property, + bool PrepareToAddItem( wxPGProperty* property, wxPGProperty* scheduledParent ); /** If visible, then this is pointer to wxPropertyGrid. @@ -682,11 +693,17 @@ protected: unsigned char m_anyModified; unsigned char m_vhCalcPending; + +private: + /** Only inits arrays, doesn't migrate things or such. */ + void InitNonCatMode(); }; #endif // #ifndef SWIG // ----------------------------------------------------------------------- +#endif // wxUSE_PROPGRID + #endif // _WX_PROPGRID_PROPGRIDPAGESTATE_H_