From 76a07a77cab522db6d8b65c77a7fede170b5b399 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 8 Oct 2008 14:32:25 +0000 Subject: [PATCH] focus propagation, fixes #10047 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/combobox.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index c09773741a..9b7e8a1de2 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -151,6 +151,17 @@ protected: if (! m_cb->GetEventHandler()->ProcessEvent(event)) event.Skip(); } + + void OnFocus( wxFocusEvent& event ) + { + // in case the textcontrol gets the focus we propagate + // it to the parent's handlers. + wxFocusEvent evt2(event.GetEventType(),m_cb->GetId()); + evt2.SetEventObject(m_cb); + m_cb->GetEventHandler()->ProcessEvent(evt2); + + event.Skip(); + } private: wxComboBox *m_cb; @@ -162,6 +173,8 @@ BEGIN_EVENT_TABLE(wxComboBoxText, wxTextCtrl) EVT_KEY_DOWN(wxComboBoxText::OnKeyDown) EVT_CHAR(wxComboBoxText::OnChar) EVT_KEY_UP(wxComboBoxText::OnKeyUp) + EVT_SET_FOCUS(wxComboBoxText::OnFocus) + EVT_KILL_FOCUS(wxComboBoxText::OnFocus) EVT_TEXT(wxID_ANY, wxComboBoxText::OnText) END_EVENT_TABLE()