Update of /cvsroot/audacity/audacity-src/src/widgets
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11304/src/widgets

Modified Files:
        Grid.cpp 
Log Message:
CTRL+TAB and CTRL+SHIFT+TAB now moves out of the grid and LEFT and RIGHT arrow 
wrap when moving beyond edges.

Index: Grid.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Grid.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Grid.cpp    8 Jan 2009 23:23:58 -0000       1.10
+++ Grid.cpp    9 Jan 2009 19:33:09 -0000       1.11
@@ -395,6 +395,39 @@
 {
    switch (event.GetKeyCode())
    {
+      case WXK_LEFT:
+      case WXK_RIGHT:
+      {
+         int rows = GetNumberRows();
+         int cols = GetNumberCols();
+         int crow = GetGridCursorRow();
+         int ccol = GetGridCursorCol();
+
+         if (event.GetKeyCode() == WXK_LEFT) {
+            if (crow == 0 && ccol == 0) {
+               // do nothing
+            }
+            else if (ccol == 0) {
+               SetGridCursor(crow - 1, cols - 1);
+            }
+            else {
+               SetGridCursor(crow, ccol - 1);
+            }
+         }
+         else {
+            if (crow == rows - 1 && ccol == cols - 1) {
+               // do nothing
+            }
+            else if (ccol == cols - 1) {
+               SetGridCursor(crow + 1, 0);
+            }
+            else {
+               SetGridCursor(crow, ccol + 1);
+            }
+         }
+      }
+      break;
+
       case WXK_TAB:
       {
          int rows = GetNumberRows();
@@ -402,7 +435,14 @@
          int crow = GetGridCursorRow();
          int ccol = GetGridCursorCol();
 
-         if (event.ShiftDown()) {
+         if (event.ControlDown()) {
+            int flags = wxNavigationKeyEvent::FromTab |
+                        ( event.ShiftDown() ?
+                          wxNavigationKeyEvent::IsBackward :
+                          wxNavigationKeyEvent::IsForward );
+            Navigate(flags);
+         }
+         else if (event.ShiftDown()) {
             if (crow == 0 && ccol == 0) {
                Navigate(wxNavigationKeyEvent::FromTab | 
wxNavigationKeyEvent::IsBackward);
                return;


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to