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:
@@ -410,17 +410,24 @@ void wxVListBoxComboPopup::OnLeftClick(wxMouseEvent& WXUNUSED(event))
|
||||
|
||||
void wxVListBoxComboPopup::OnKey(wxKeyEvent& event)
|
||||
{
|
||||
// Select item if ENTER is pressed
|
||||
if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER )
|
||||
{
|
||||
DismissWithEvent();
|
||||
}
|
||||
// Hide popup if ESC is pressed
|
||||
else if ( event.GetKeyCode() == WXK_ESCAPE )
|
||||
// Hide popup if certain key or key combination was pressed
|
||||
if ( m_combo->IsKeyPopupToggle(event) )
|
||||
{
|
||||
StopPartialCompletion();
|
||||
Dismiss();
|
||||
}
|
||||
else if ( event.AltDown() )
|
||||
{
|
||||
// On both wxGTK and wxMSW, pressing Alt down seems to
|
||||
// completely freeze things in popup (ie. arrow keys and
|
||||
// enter won't work).
|
||||
return;
|
||||
}
|
||||
// Select item if ENTER is pressed
|
||||
else if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER )
|
||||
{
|
||||
DismissWithEvent();
|
||||
}
|
||||
else
|
||||
{
|
||||
int comboStyle = m_combo->GetWindowStyle();
|
||||
|
Reference in New Issue
Block a user