From: Václav Slavík Date: Mon, 5 Apr 2010 17:18:50 +0000 (+0000) Subject: wxOwnerDrawnComboBox: handle numpad navigation keys. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/293987e80c5be7aa499e2a3467bc5b57a0a43648 wxOwnerDrawnComboBox: handle numpad navigation keys. For consitency with the native control, up/down/pgup/pgdown keys should be handled even when pressed on the numpad. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index e70047106d..711f1abcf1 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -271,22 +271,22 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode } } - if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) + if ( keycode == WXK_DOWN || keycode == WXK_NUMPAD_DOWN || keycode == WXK_RIGHT ) { value++; StopPartialCompletion(); } - else if ( keycode == WXK_UP || keycode == WXK_LEFT ) + else if ( keycode == WXK_UP || keycode == WXK_NUMPAD_UP || keycode == WXK_LEFT ) { value--; StopPartialCompletion(); } - else if ( keycode == WXK_PAGEDOWN ) + else if ( keycode == WXK_PAGEDOWN || keycode == WXK_NUMPAD_PAGEDOWN ) { value+=10; StopPartialCompletion(); } - else if ( keycode == WXK_PAGEUP ) + else if ( keycode == WXK_PAGEUP || keycode == WXK_NUMPAD_PAGEUP ) { value-=10; StopPartialCompletion(); diff --git a/src/generic/vlbox.cpp b/src/generic/vlbox.cpp index 551177def5..a80cc97e13 100644 --- a/src/generic/vlbox.cpp +++ b/src/generic/vlbox.cpp @@ -605,14 +605,17 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event) switch ( event.GetKeyCode() ) { case WXK_HOME: + case WXK_NUMPAD_HOME: current = 0; break; case WXK_END: + case WXK_NUMPAD_END: current = GetRowCount() - 1; break; case WXK_DOWN: + case WXK_NUMPAD_DOWN: if ( m_current == (int)GetRowCount() - 1 ) return; @@ -620,6 +623,7 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event) break; case WXK_UP: + case WXK_NUMPAD_UP: if ( m_current == wxNOT_FOUND ) current = GetRowCount() - 1; else if ( m_current != 0 ) @@ -629,11 +633,13 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event) break; case WXK_PAGEDOWN: + case WXK_NUMPAD_PAGEDOWN: PageDown(); current = GetVisibleBegin(); break; case WXK_PAGEUP: + case WXK_NUMPAD_PAGEUP: if ( m_current == (int)GetVisibleBegin() ) { PageUp(); diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 3cbae3b335..9d63aa4830 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -831,6 +831,8 @@ bool wxComboCtrl::IsKeyPopupToggle(const wxKeyEvent& event) const case WXK_DOWN: case WXK_UP: + case WXK_NUMPAD_DOWN: + case WXK_NUMPAD_UP: // On XP or with writable combo in Classic, arrows don't open the // popup but Alt-arrow does if ( event.AltDown() ||