Resolve ambiguity in multiple inheritance of function GetPropertyByLabel in wxPGPage.
In wxPropertyGridPage class derived from wxPropertyGridPageState and wxPropertyGridInterface, function GetPropertyByLabel is inherited from both base classes. To resolve this ambiguity, function defined in wxPGInterface is introduced in wxPGPage through 'using-declaration'. (This is a temporary fix and finally GetPropertyByLabel function should be removed from wxPropertyGridPageState.) See #15251. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
cc48521426
commit
1a2983d433
@ -157,6 +157,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetSplitterPosition( int splitterPos, int col = 0 );
|
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:
|
protected:
|
||||||
|
|
||||||
/** Propagate to other pages.
|
/** Propagate to other pages.
|
||||||
|
@ -556,8 +556,11 @@ public:
|
|||||||
|
|
||||||
wxPropertyCategory* GetPropertyCategory( const wxPGProperty* p ) const;
|
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* GetPropertyByLabel( const wxString& name,
|
||||||
wxPGProperty* parent = NULL ) const;
|
wxPGProperty* parent = NULL ) const;
|
||||||
|
#endif // WXWIN_COMPATIBILITY_3_0
|
||||||
|
|
||||||
wxVariant DoGetPropertyValues( const wxString& listname,
|
wxVariant DoGetPropertyValues( const wxString& listname,
|
||||||
wxPGProperty* baseparent,
|
wxPGProperty* baseparent,
|
||||||
@ -690,6 +693,10 @@ protected:
|
|||||||
bool PrepareToAddItem( wxPGProperty* property,
|
bool PrepareToAddItem( wxPGProperty* property,
|
||||||
wxPGProperty* scheduledParent );
|
wxPGProperty* scheduledParent );
|
||||||
|
|
||||||
|
/** Returns property by its label. */
|
||||||
|
wxPGProperty* BaseGetPropertyByLabel( const wxString& label,
|
||||||
|
wxPGProperty* parent = NULL ) const;
|
||||||
|
|
||||||
/** If visible, then this is pointer to wxPropertyGrid.
|
/** If visible, then this is pointer to wxPropertyGrid.
|
||||||
This shall *never* be NULL to indicate that this state is not visible.
|
This shall *never* be NULL to indicate that this state is not visible.
|
||||||
*/
|
*/
|
||||||
|
@ -444,15 +444,23 @@ wxPropertyCategory* wxPropertyGridPageState::GetPropertyCategory( const wxPGProp
|
|||||||
// wxPropertyGridPageState GetPropertyXXX methods
|
// wxPropertyGridPageState GetPropertyXXX methods
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel( const wxString& label,
|
#ifdef WXWIN_COMPATIBILITY_3_0
|
||||||
wxPGProperty* parent ) const
|
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 ( size_t i=0; i<parent->GetChildCount(); i++ )
|
||||||
|
|
||||||
for ( i=0; i<parent->GetChildCount(); i++ )
|
|
||||||
{
|
{
|
||||||
wxPGProperty* p = parent->Item(i);
|
wxPGProperty* p = parent->Item(i);
|
||||||
if ( p->m_label == label )
|
if ( p->m_label == label )
|
||||||
@ -460,7 +468,7 @@ wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel( const wxString& label
|
|||||||
// Check children recursively.
|
// Check children recursively.
|
||||||
if ( p->GetChildCount() )
|
if ( p->GetChildCount() )
|
||||||
{
|
{
|
||||||
p = GetPropertyByLabel(label,(wxPGProperty*)p);
|
p = BaseGetPropertyByLabel(label, p);
|
||||||
if ( p )
|
if ( p )
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user