]> git.saurik.com Git - wxWidgets.git/commitdiff
Set focus to the grid windwo when it is left-clicked
authorRobin Dunn <robin@alldunn.com>
Fri, 20 May 2005 16:17:57 +0000 (16:17 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 20 May 2005 16:17:57 +0000 (16:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 78e502fc7557a2dcf865761cacd41680d35ede0e..66b281a0330c0a6c3f42a61a8600d7ba07a414b7 100644 (file)
@@ -3758,6 +3758,9 @@ void wxGridWindow::ScrollWindow( int dx, int dy, const wxRect *rect )
 
 void wxGridWindow::OnMouseEvent( wxMouseEvent& event )
 {
 
 void wxGridWindow::OnMouseEvent( wxMouseEvent& event )
 {
+    if (event.ButtonDown(wxMOUSE_BTN_LEFT) && FindFocus() != this)
+        SetFocus();
+    
     m_owner->ProcessGridCellMouseEvent( event );
 }
 
     m_owner->ProcessGridCellMouseEvent( event );
 }