Have wxComboCtrl respect parent's wxTAB_TRAVERSAL flag; Also cleaned up key event redirecting code (backported from trunk)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@59691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -580,14 +580,17 @@ void wxComboBoxExtraInputHandler::OnKey(wxKeyEvent& event)
|
|||||||
{
|
{
|
||||||
// Let the wxComboCtrl event handler have a go first.
|
// Let the wxComboCtrl event handler have a go first.
|
||||||
wxComboCtrlBase* combo = m_combo;
|
wxComboCtrlBase* combo = m_combo;
|
||||||
wxObject* prevObj = event.GetEventObject();
|
|
||||||
|
|
||||||
event.SetId(combo->GetId());
|
wxKeyEvent redirectedEvent(event);
|
||||||
event.SetEventObject(combo);
|
redirectedEvent.SetId(combo->GetId());
|
||||||
combo->GetEventHandler()->ProcessEvent(event);
|
redirectedEvent.SetEventObject(combo);
|
||||||
|
|
||||||
event.SetId(((wxWindow*)prevObj)->GetId());
|
if ( !combo->GetEventHandler()->ProcessEvent(redirectedEvent) )
|
||||||
event.SetEventObject(prevObj);
|
{
|
||||||
|
// Don't let TAB through to the text ctrl - looks ugly
|
||||||
|
if ( event.GetKeyCode() != WXK_TAB )
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event)
|
void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event)
|
||||||
@@ -1602,7 +1605,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
|
|||||||
{
|
{
|
||||||
int keycode = event.GetKeyCode();
|
int keycode = event.GetKeyCode();
|
||||||
|
|
||||||
if ( keycode == WXK_TAB )
|
if ( GetParent()->HasFlag(wxTAB_TRAVERSAL) &&
|
||||||
|
keycode == WXK_TAB )
|
||||||
{
|
{
|
||||||
wxNavigationKeyEvent evt;
|
wxNavigationKeyEvent evt;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user