]> git.saurik.com Git - wxWidgets.git/commitdiff
only set focus to the grid window in wxGrid::HideCellEditControl() if it hadn't been...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Jul 2005 11:22:24 +0000 (11:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Jul 2005 11:22:24 +0000 (11:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index a04ed8c350e2b923b46d723f275a3b8a5ad5602f..874499b1e2d4d26ceebda854c1707c9f7f02e21c 100644 (file)
@@ -7863,7 +7863,13 @@ void wxGrid::HideCellEditControl()
         editor->Show( false );
         editor->DecRef();
         attr->DecRef();
-        m_gridWin->SetFocus();
+
+        // if the focus moved completely outside this application, set it to
+        // ourselves so that it's not "lost" when the user switches back to
+        // this app
+        if ( !FindFocus() )
+            m_gridWin->SetFocus();
+
         // refresh whole row to the right
         wxRect rect( CellToRect(row, col) );
         CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y );