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:
@@ -1217,8 +1217,32 @@ void wxPropertyGridPageState::DoRemoveFromSelection( wxPGProperty* prop )
|
|||||||
for ( unsigned int i=0; i<m_selection.size(); i++ )
|
for ( unsigned int i=0; i<m_selection.size(); i++ )
|
||||||
{
|
{
|
||||||
if ( m_selection[i] == prop )
|
if ( m_selection[i] == prop )
|
||||||
|
{
|
||||||
|
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 );
|
m_selection.erase( m_selection.begin() + i );
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user