]> git.saurik.com Git - wxWidgets.git/commitdiff
generate focus and kill focus events for wxTextCtrl at wxWindow level instead of...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Jan 2008 09:34:05 +0000 (09:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Jan 2008 09:34:05 +0000 (09:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textctrl.cpp
src/msw/window.cpp

index 0a8e54ea59d3f5459221219848a130458ae2b5bb..9293dcebb717c9b6a936dbb25073dbe6f6a88c41 100644 (file)
@@ -1928,17 +1928,6 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 {
     switch ( param )
     {
-        case EN_SETFOCUS:
-        case EN_KILLFOCUS:
-            {
-                wxFocusEvent event(param == EN_KILLFOCUS ? wxEVT_KILL_FOCUS
-                                                         : wxEVT_SET_FOCUS,
-                                   m_windowId);
-                event.SetEventObject(this);
-                HandleWindowEvent(event);
-            }
-            break;
-
         case EN_CHANGE:
             SendUpdateEvent();
             break;
@@ -1954,7 +1943,9 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
             }
             break;
 
-            // the other edit notification messages are not processed
+            // the other edit notification messages are not processed (or, in
+            // the case of EN_{SET/KILL}FOCUS were already handled at WM_SET/
+            // KILLFOCUS level)
         default:
             return false;
     }
index 01404611b6385ecd74540671b21c4717b54550f3..25e1dea9284d5983f5525fb0a53eec9d9c2e8f65 100644 (file)
@@ -3978,15 +3978,6 @@ bool wxWindowMSW::HandleSetFocus(WXHWND hwnd)
     }
 #endif // wxUSE_CARET
 
-#if wxUSE_TEXTCTRL
-    // If it's a wxTextCtrl don't send the event as it will be done
-    // after the control gets to process it from EN_FOCUS handler
-    if ( wxDynamicCastThis(wxTextCtrl) )
-    {
-        return false;
-    }
-#endif // wxUSE_TEXTCTRL
-
     wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
     event.SetEventObject(this);
 
@@ -4006,16 +3997,6 @@ bool wxWindowMSW::HandleKillFocus(WXHWND hwnd)
     }
 #endif // wxUSE_CARET
 
-#if wxUSE_TEXTCTRL
-    // If it's a wxTextCtrl don't send the event as it will be done
-    // after the control gets to process it.
-    wxTextCtrl *ctrl = wxDynamicCastThis(wxTextCtrl);
-    if ( ctrl )
-    {
-        return false;
-    }
-#endif
-
     // Don't send the event when in the process of being deleted.  This can
     // only cause problems if the event handler tries to access the object.
     if ( m_isBeingDeleted )