X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6cf5edea273b08316390683a17851a2437103da4..4090fe84c47112e59b7a3e88bc805c781ee4d10d:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 44dd00af8f..bfa70e3838 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1911,7 +1911,7 @@ void wxPGProperty::SetChoiceSelection( int newValue ) } } -bool wxPGProperty::SetChoices( wxPGChoices& choices ) +bool wxPGProperty::SetChoices( const wxPGChoices& choices ) { // Property must be de-selected first (otherwise choices in // the control would be de-synced with true choices) @@ -1962,6 +1962,32 @@ const wxPGEditor* wxPGProperty::GetEditorClass() const return editor; } +bool wxPGProperty::Hide( bool hide, int flags ) +{ + wxPropertyGrid* pg = GetGrid(); + if ( pg ) + return pg->HideProperty(this, hide, flags); + + return DoHide( hide, flags ); +} + +bool wxPGProperty::DoHide( bool hide, int flags ) +{ + if ( !hide ) + ClearFlag( wxPG_PROP_HIDDEN ); + else + SetFlag( wxPG_PROP_HIDDEN ); + + if ( flags & wxPG_RECURSE ) + { + unsigned int i; + for ( i = 0; i < GetChildCount(); i++ ) + Item(i)->DoHide(hide, flags | wxPG_RECURSE_STARTS); + } + + return true; +} + bool wxPGProperty::HasVisibleChildren() const { unsigned int i;