From 3c26d11be9e0e1a69da888d69cd980d77827c6eb Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sun, 21 Sep 2008 15:42:08 +0000 Subject: [PATCH] Moved SetPropertyAttributeAll() to wxPropertyGridInterface git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/propgrid/manager.h | 6 ----- include/wx/propgrid/propgrid.h | 6 ----- include/wx/propgrid/propgridiface.h | 6 +++++ interface/wx/propgrid/manager.h | 6 ----- interface/wx/propgrid/propgrid.h | 6 ----- interface/wx/propgrid/propgridiface.h | 6 +++++ src/propgrid/manager.cpp | 13 ----------- src/propgrid/propgrid.cpp | 5 ---- src/propgrid/propgridiface.cpp | 33 ++++++++++++++++++++++----- 9 files changed, 39 insertions(+), 48 deletions(-) diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index 981c00b621..1b84265dd0 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -595,12 +595,6 @@ public: /** Sets y coordinate of the description box splitter. */ void SetDescBoxHeight( int ht, bool refresh = true ); - /** Sets property attribute for all applicapple properties. - Be sure to use this method after all properties have been - added to the grid. - */ - void SetPropertyAttributeAll( const wxString& name, wxVariant value ); - /** Moves splitter as left as possible, while still allowing all labels to be shown in full. @param subProps diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index dc75e9b1e8..4fce66d137 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -966,12 +966,6 @@ public: /** Sets background colour of margin. */ void SetMarginColour(const wxColour& col); - /** Sets property attribute for all applicapple properties. - Be sure to use this method only after all properties have been - added to the grid. - */ - void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); - /** Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. diff --git a/include/wx/propgrid/propgridiface.h b/include/wx/propgrid/propgridiface.h index 76aa1afa76..82a47a7cfe 100644 --- a/include/wx/propgrid/propgridiface.h +++ b/include/wx/propgrid/propgridiface.h @@ -908,6 +908,12 @@ public: DoSetPropertyAttribute(id,attrName,value,argFlags); } + /** Sets property attribute for all applicapple properties. + Be sure to use this method only after all properties have been + added to the grid. + */ + void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); + /** Sets attributes from a wxPGAttributeStorage. */ void SetPropertyAttributes( wxPGPropArg id, diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index f838f7ca03..56c75f0218 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -483,12 +483,6 @@ public: /** Sets y coordinate of the description box splitter. */ void SetDescBoxHeight( int ht, bool refresh = true ); - /** Sets property attribute for all applicapple properties. - Be sure to use this method after all properties have been - added to the grid. - */ - void SetPropertyAttributeAll( const wxString& name, wxVariant value ); - /** Moves splitter as left as possible, while still allowing all labels to be shown in full. @param subProps diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 76cd3203e7..367bb40e88 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -647,12 +647,6 @@ public: /** Sets background colour of margin. */ void SetMarginColour(const wxColour& col); - /** Sets property attribute for all applicapple properties. - Be sure to use this method only after all properties have been - added to the grid. - */ - void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); - /** Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index c273dfc161..950c16c8d8 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -665,6 +665,12 @@ public: DoSetPropertyAttribute(id,attrName,value,argFlags); } + /** Sets property attribute for all applicapple properties. + Be sure to use this method only after all properties have been + added to the grid. + */ + void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); + /** Sets attributes from a wxPGAttributeStorage. */ void SetPropertyAttributes( wxPGPropArg id, const wxPGAttributeStorage& attributes ) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 5864d13b5e..d328984250 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -703,19 +703,6 @@ void wxPropertyGridManager::SetColumnCount( int colCount, int page ) } // ----------------------------------------------------------------------- -void wxPropertyGridManager::SetPropertyAttributeAll( const wxString& attrName, wxVariant value ) -{ - size_t i; - for ( i=0; iGetStatePtr()->m_properties, attrName, value, wxPG_RECURSE); - } -} - -// ----------------------------------------------------------------------- - size_t wxPropertyGridManager::GetPageCount() const { if ( !(m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) ) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index fc40bcf90b..cdafad48f0 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -6016,11 +6016,6 @@ wxEvent* wxPropertyGridEvent::Clone() const return new wxPropertyGridEvent( *this ); } -void wxPropertyGrid::SetPropertyAttributeAll( const wxString& attrName, wxVariant value ) -{ - DoSetPropertyAttribute(GetRoot(), attrName, value, wxPG_RECURSE); -} - // ----------------------------------------------------------------------- // wxPropertyGridPopulator // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 74b071871d..78540a738f 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -549,6 +549,24 @@ void wxPropertyGridInterface::DoSetPropertyAttribute( wxPGPropArg id, const wxSt // ----------------------------------------------------------------------- +void wxPropertyGridInterface::SetPropertyAttributeAll( const wxString& attrName, + wxVariant value ) +{ + unsigned int pageIndex = 0; + + for (;;) + { + wxPropertyGridPageState* page = GetPageState(pageIndex); + if ( !page ) break; + + DoSetPropertyAttribute(page->DoGetRoot(), attrName, value, wxPG_RECURSE); + + pageIndex++; + } +} + +// ----------------------------------------------------------------------- + void wxPropertyGridInterface::GetPropertiesWithFlag( wxArrayPGProperty* targetArr, wxPGProperty::FlagType flags, bool inverse, @@ -874,14 +892,17 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const // // Save state on page basis - size_t pageIndex = 0; - wxPropertyGridPageState* pageState = GetPageState(pageIndex); + unsigned int pageIndex = 0; wxArrayPtrVoid pageStates; - while ( pageState ) + + for (;;) { - pageStates.Add(pageState); - pageIndex += 1; - pageState = GetPageState(pageIndex); + wxPropertyGridPageState* page = GetPageState(pageIndex); + if ( !page ) break; + + pageStates.Add(page); + + pageIndex++; } for ( pageIndex=0; pageIndex < pageStates.size(); pageIndex++ ) -- 2.47.2