X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/613351172aaff8571b2795f7798fee9d1810db85..24aab8e81a8627802e4111d9c99a50ece8d0026e:/src/generic/combog.cpp?ds=sidebyside diff --git a/src/generic/combog.cpp b/src/generic/combog.cpp index 5559bff3c8..d970168df3 100644 --- a/src/generic/combog.cpp +++ b/src/generic/combog.cpp @@ -161,7 +161,7 @@ bool wxGenericComboControl::Create(wxWindow *parent, CreateTextCtrl( wxNO_BORDER, validator ); // Add keyboard input handlers for main control and textctrl - InstallInputHandlers( true ); + InstallInputHandlers(); // Set background SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering @@ -288,7 +288,7 @@ void wxGenericComboControl::OnMouseEvent( wxMouseEvent& event ) if ( PreprocessMouseEvent(event,handlerFlags) ) return; - const bool ctrlIsButton = wxPlatformIs(wxMSW); + const bool ctrlIsButton = wxPlatformIs(wxOS_WINDOWS); if ( ctrlIsButton && (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY ) @@ -321,6 +321,28 @@ void wxGenericComboControl::OnMouseEvent( wxMouseEvent& event ) } +bool wxGenericComboControl::IsKeyPopupToggle(const wxKeyEvent& event) const +{ + int keycode = event.GetKeyCode(); + bool isPopupShown = IsPopupShown(); + + // This code is AFAIK appropriate for wxGTK. + + if ( isPopupShown ) + { + if ( keycode == WXK_ESCAPE || + ( keycode == WXK_UP && event.AltDown() ) ) + return true; + } + else + { + if ( keycode == WXK_DOWN && event.AltDown() ) + return true; + } + + return false; +} + #ifdef __WXUNIVERSAL__ bool wxGenericComboControl::PerformAction(const wxControlAction& action,