diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index 0d1f8f5e87..d33384a262 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -157,6 +157,12 @@ public: */ void SetSplitterPosition( int splitterPos, int col = 0 ); +#ifdef WXWIN_COMPATIBILITY_3_0 + // To avoid ambiguity between functions inherited + // from both wxPropertyGridInterface and wxPropertyGridPageState + using wxPropertyGridInterface::GetPropertyByLabel; +#endif // WXWIN_COMPATIBILITY_3_0 + protected: /** Propagate to other pages. diff --git a/include/wx/propgrid/propgridpagestate.h b/include/wx/propgrid/propgridpagestate.h index 77f38b2891..b6bec54b73 100644 --- a/include/wx/propgrid/propgridpagestate.h +++ b/include/wx/propgrid/propgridpagestate.h @@ -556,8 +556,11 @@ public: wxPropertyCategory* GetPropertyCategory( const wxPGProperty* p ) const; +#ifdef WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("don't refer directly to wxPropertyGridPageState::GetPropertyByLabel") wxPGProperty* GetPropertyByLabel( const wxString& name, wxPGProperty* parent = NULL ) const; +#endif // WXWIN_COMPATIBILITY_3_0 wxVariant DoGetPropertyValues( const wxString& listname, wxPGProperty* baseparent, @@ -690,6 +693,10 @@ protected: bool PrepareToAddItem( wxPGProperty* property, wxPGProperty* scheduledParent ); + /** Returns property by its label. */ + wxPGProperty* BaseGetPropertyByLabel( const wxString& label, + wxPGProperty* parent = NULL ) const; + /** If visible, then this is pointer to wxPropertyGrid. This shall *never* be NULL to indicate that this state is not visible. */ diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 84ed9d2340..32ac784b3c 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -444,15 +444,23 @@ wxPropertyCategory* wxPropertyGridPageState::GetPropertyCategory( const wxPGProp // wxPropertyGridPageState GetPropertyXXX methods // ----------------------------------------------------------------------- -wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel( const wxString& label, - wxPGProperty* parent ) const +#ifdef WXWIN_COMPATIBILITY_3_0 +wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel + ( const wxString& label, wxPGProperty* parent ) const { + return BaseGetPropertyByLabel(label, parent); +} +#endif // WXWIN_COMPATIBILITY_3_0 - size_t i; +wxPGProperty* wxPropertyGridPageState::BaseGetPropertyByLabel + ( const wxString& label, wxPGProperty* parent ) const +{ + if ( !parent ) + { + parent = (wxPGProperty*) &m_regularArray; + } - if ( !parent ) parent = (wxPGProperty*) &m_regularArray; - - for ( i=0; iGetChildCount(); i++ ) + for ( size_t i=0; iGetChildCount(); i++ ) { wxPGProperty* p = parent->Item(i); if ( p->m_label == label ) @@ -460,7 +468,7 @@ wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel( const wxString& label // Check children recursively. if ( p->GetChildCount() ) { - p = GetPropertyByLabel(label,(wxPGProperty*)p); + p = BaseGetPropertyByLabel(label, p); if ( p ) return p; }