added wxWindow::HandleAsNavigationKey() helper for handling (not only) TAB key in custom controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1651,22 +1651,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
|
||||
}
|
||||
else // no popup
|
||||
{
|
||||
int keycode = event.GetKeyCode();
|
||||
|
||||
if ( keycode == WXK_TAB )
|
||||
{
|
||||
wxNavigationKeyEvent evt;
|
||||
|
||||
wxWindow* mainCtrl = GetMainWindowOfCompositeControl();
|
||||
|
||||
evt.SetFlags(wxNavigationKeyEvent::FromTab|
|
||||
(!event.ShiftDown() ? wxNavigationKeyEvent::IsForward
|
||||
: wxNavigationKeyEvent::IsBackward));
|
||||
evt.SetEventObject(mainCtrl);
|
||||
evt.SetCurrentFocus(mainCtrl);
|
||||
mainCtrl->GetParent()->GetEventHandler()->AddPendingEvent(evt);
|
||||
if ( HandleAsNavigationKey(event) )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( IsKeyPopupToggle(event) )
|
||||
{
|
||||
@@ -1683,6 +1669,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
int keycode = event.GetKeyCode();
|
||||
|
||||
if ( (comboStyle & wxCB_READONLY) ||
|
||||
(keycode != WXK_RIGHT && keycode != WXK_LEFT) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user