]> git.saurik.com Git - wxWidgets.git/commitdiff
Set the window in focus event sent by wxComboCtrl correctly.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Dec 2010 14:00:31 +0000 (14:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Dec 2010 14:00:31 +0000 (14:00 +0000)
The window parameter wasn't copied correctly in the forwarded event. Fix this
and avoid future problems of the same kind by using the copy ctor for creating
the new event and then override the fields that we need to change from the
original event instead of recreating the new event from bits and pieces of the
original one.

Closes #12741.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/combocmn.cpp

index 15298838f0c09fd3ff364a91dd953a543834fc0e..e87b7df0d8aad5d3387c28d8f07362eb6501140f 100644 (file)
@@ -673,7 +673,8 @@ void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event)
     //     wxEVT_SET_FOCUSes (since m_text->SetFocus is called
     //     from combo's focus event handler), they should be quite
     //     harmless.
-    wxFocusEvent evt2(event.GetEventType(),m_combo->GetId());
+    wxFocusEvent evt2(event);
+    evt2.SetId(m_combo->GetId());
     evt2.SetEventObject(m_combo);
     m_combo->GetEventHandler()->ProcessEvent(evt2);