Fix focus issue with composite grid editor windows

The grid editor window can be composite, so check whether it or one of
its children focus has focus when determining whether we should set the
focus to the grid when the grid editor is being hidden, otherwise the
focus was simply lost when such an editor was hidden.

Closes https://github.com/wxWidgets/wxWidgets/pull/1599
This commit is contained in:
Ilya Sinitsyn
2019-10-10 00:43:34 +07:00
committed by Vadim Zeitlin
parent 280f80fdfd
commit dc99faa096

View File

@@ -7088,7 +7088,7 @@ void wxGrid::HideCellEditControl()
wxGridCellAttr *attr = GetCellAttr(row, col); wxGridCellAttr *attr = GetCellAttr(row, col);
wxGridCellEditor *editor = attr->GetEditor(this, row, col); wxGridCellEditor *editor = attr->GetEditor(this, row, col);
const bool editorHadFocus = editor->GetWindow()->HasFocus(); const bool editorHadFocus = editor->GetWindow()->IsDescendant(FindFocus());
if ( editor->GetWindow()->GetParent() != m_gridWin ) if ( editor->GetWindow()->GetParent() != m_gridWin )
editor->GetWindow()->Reparent(m_gridWin); editor->GetWindow()->Reparent(m_gridWin);