better key handling for MSW and GTK (patch 1526666)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-08-13 00:35:02 +00:00
parent d1af8e2dd9
commit b445b6a76e
7 changed files with 157 additions and 87 deletions

View File

@@ -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
@@ -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,