X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/640a91ab0b3b8ca8d3334516c19cfdbf5dc467b0..fc32630a5e03e60a67d4ef53fc59985ea087b451:/src/common/combocmn.cpp diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index c39695b34b..6ed975c8a8 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -34,6 +34,7 @@ #include "wx/settings.h" #include "wx/dialog.h" #include "wx/timer.h" + #include "wx/textctrl.h" #endif #include "wx/tooltip.h" @@ -85,10 +86,10 @@ #elif defined(__WXMAC__) -#define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform) -#define TRANSIENT_POPUPWIN_IS_PERFECT 0 // wxPopupTransientWindow works, its child can have focus, and common +#define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform) +#define TRANSIENT_POPUPWIN_IS_PERFECT 1 // wxPopupTransientWindow works, its child can have focus, and common // native controls work on it like normal. -#define POPUPWIN_IS_PERFECT 0 // Same, but for non-transient popup window. +#define POPUPWIN_IS_PERFECT 1 // Same, but for non-transient popup window. #define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered #define FOCUS_RING 3 // Reserve room for the textctrl's focus ring to display @@ -112,7 +113,7 @@ // Popupwin is really only supported on wxMSW (not WINCE) and wxGTK, regardless // what the wxUSE_POPUPWIN says. // FIXME: Why isn't wxUSE_POPUPWIN reliable any longer? (it was in wxW2.6.2) -#if (!defined(__WXMSW__) && !defined(__WXGTK__)) || defined(__WXWINCE__) +#if (!defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMAC__)) || defined(__WXWINCE__) #undef wxUSE_POPUPWIN #define wxUSE_POPUPWIN 0 #endif @@ -1650,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) ) { @@ -1682,6 +1669,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event) return; } + int keycode = event.GetKeyCode(); + if ( (comboStyle & wxCB_READONLY) || (keycode != WXK_RIGHT && keycode != WXK_LEFT) ) {