]> git.saurik.com Git - wxWidgets.git/commitdiff
wxOwnerDrawnComboBox: handle numpad navigation keys.
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:50 +0000 (17:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:50 +0000 (17:18 +0000)
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

src/generic/odcombo.cpp
src/generic/vlbox.cpp
src/msw/combo.cpp

index e70047106d4b1c3202694400792f333de3ffb591..711f1abcf136ff5bf2e449b2ac48a49daf79d904 100644 (file)
@@ -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();
index 551177def5333d13ccb6fdc8eab48184ecb921ff..a80cc97e13706965f1505c71561f1d80ec70bc0b 100644 (file)
@@ -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();
index 3cbae3b3358d5d0536cdbed23f2b0b1d55e2e353..9d63aa48300d0cfc072dd96fb1464e10614c3906 100644 (file)
@@ -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() ||