don't steal focus back to wxGrid when it hides an editor in the result of losing it (#9844)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8508,10 +8508,17 @@ 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->GetControl()->HasFocus();
|
||||||
editor->Show( false );
|
editor->Show( false );
|
||||||
editor->DecRef();
|
editor->DecRef();
|
||||||
attr->DecRef();
|
attr->DecRef();
|
||||||
|
|
||||||
|
// return the focus to the grid itself if the editor had it
|
||||||
|
//
|
||||||
|
// note that we must not do this unconditionally to avoid stealing
|
||||||
|
// focus from the window which just received it if we are hiding the
|
||||||
|
// editor precisely because we lost focus
|
||||||
|
if ( editorHadFocus )
|
||||||
m_gridWin->SetFocus();
|
m_gridWin->SetFocus();
|
||||||
|
|
||||||
// refresh whole row to the right
|
// refresh whole row to the right
|
||||||
|
Reference in New Issue
Block a user