X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01b5ad3b500627ae3ebadc755f47c816a859e6bb..737e53350cffa493e72691fd965ebd60d5349bf2:/src/propgrid/propgridiface.cpp?ds=sidebyside diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index ff891b9f4f..1984ce6bb4 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -102,7 +102,7 @@ void wxPropertyGridInterface::RefreshGrid( wxPropertyGridPageState* state ) wxPGProperty* wxPropertyGridInterface::Append( wxPGProperty* property ) { wxPGProperty* retp = m_pState->DoAppend(property); - + wxPropertyGrid* grid = m_pState->GetGrid(); if ( grid ) grid->RefreshGrid(); @@ -147,10 +147,6 @@ void wxPropertyGridInterface::DeleteProperty( wxPGPropArg id ) wxPG_PROP_ARG_CALL_PROLOG() wxPropertyGridPageState* state = p->GetParentState(); - wxPropertyGrid* grid = state->GetGrid(); - - if ( grid->GetState() == state ) - grid->DoSelectProperty(NULL, wxPG_SEL_DELETING|wxPG_SEL_NOVALIDATE); state->DoDelete( p, true ); @@ -167,13 +163,6 @@ wxPGProperty* wxPropertyGridInterface::RemoveProperty( wxPGPropArg id ) wxNullProperty); wxPropertyGridPageState* state = p->GetParentState(); - wxPropertyGrid* grid = state->GetGrid(); - - if ( grid->GetState() == state ) - { - grid->DoSelectProperty(NULL, - wxPG_SEL_DELETING|wxPG_SEL_NOVALIDATE); - } state->DoDelete( p, false ); @@ -218,11 +207,29 @@ wxPGProperty* wxPropertyGridInterface::ReplaceProperty( wxPGPropArg id, wxPGProp // wxPropertyGridInterface property operations // ----------------------------------------------------------------------- +wxPGProperty* wxPropertyGridInterface::GetSelection() const +{ + return m_pState->GetSelection(); +} + +// ----------------------------------------------------------------------- + bool wxPropertyGridInterface::ClearSelection( bool validation ) { - int flags = wxPG_SEL_DONT_SEND_EVENT; + bool res = DoClearSelection(validation, wxPG_SEL_DONT_SEND_EVENT); + wxPropertyGrid* pg = GetPropertyGrid(); + if ( pg ) + pg->Refresh(); + return res; +} + +// ----------------------------------------------------------------------- + +bool wxPropertyGridInterface::DoClearSelection( bool validation, + int selFlags ) +{ if ( !validation ) - flags |= wxPG_SEL_NOVALIDATE; + selFlags |= wxPG_SEL_NOVALIDATE; wxPropertyGridPageState* state = m_pState; @@ -230,9 +237,9 @@ bool wxPropertyGridInterface::ClearSelection( bool validation ) { wxPropertyGrid* pg = state->GetGrid(); if ( pg->GetState() == state ) - return pg->DoSelectProperty(NULL, flags); + return pg->DoSelectProperty(NULL, selFlags); else - state->SetSelection(NULL); + state->DoSetSelection(NULL); } return true; @@ -857,7 +864,7 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const if ( includedStates & ExpandedState ) { wxArrayPGProperty ptrs; - wxPropertyGridConstIterator it = + wxPropertyGridConstIterator it = wxPropertyGridConstIterator( pageState, wxPG_ITERATE_ALL_PARENTS_RECURSIVELY|wxPG_ITERATE_HIDDEN, wxNullProperty ); @@ -961,7 +968,7 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res { if ( restoreStates & ExpandedState ) { - wxPropertyGridIterator it = + wxPropertyGridIterator it = wxPropertyGridIterator( pageState, wxPG_ITERATE_ALL, wxNullProperty ); @@ -1026,7 +1033,7 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res else { if ( values[0].length() ) - pageState->SetSelection(GetPropertyByName(value)); + pageState->DoSetSelection(GetPropertyByName(value)); else pageState->DoClearSelection(); }