Have DoRemoveFromSelection() take active editor into account
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9a038ddca4
commit
afaf3b7037
@ -1218,7 +1218,31 @@ void wxPropertyGridPageState::DoRemoveFromSelection( wxPGProperty* prop )
|
||||
{
|
||||
if ( m_selection[i] == prop )
|
||||
{
|
||||
m_selection.erase( m_selection.begin() + i );
|
||||
wxPropertyGrid* pg = m_pPropGrid;
|
||||
if ( i == 0 && pg->GetState() == this )
|
||||
{
|
||||
// If first item (ie. one with the active editor) was
|
||||
// deselected, then we need to take some extra measures.
|
||||
wxArrayPGProperty sel = m_selection;
|
||||
sel.erase( sel.begin() + i );
|
||||
|
||||
wxPGProperty* newFirst;
|
||||
if ( sel.size() )
|
||||
newFirst = sel[0];
|
||||
else
|
||||
newFirst = NULL;
|
||||
|
||||
pg->DoSelectProperty(newFirst,
|
||||
wxPG_SEL_DONT_SEND_EVENT);
|
||||
|
||||
m_selection = sel;
|
||||
|
||||
pg->Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_selection.erase( m_selection.begin() + i );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user