focus propagation, fixes #10047

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2008-10-08 14:35:32 +00:00
parent 0f626acb66
commit 9044b125fd

View File

@ -137,6 +137,16 @@ protected:
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;
@ -147,6 +157,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()