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

Modified Files:
        Grid.cpp Grid.h 
Log Message:
Ensure screen reader gets notified of new cell position for certain keystrokes.

Index: Grid.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Grid.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Grid.cpp    9 Jun 2009 03:21:42 -0000       1.16
+++ Grid.cpp    12 Jun 2009 02:41:26 -0000      1.17
@@ -336,6 +336,7 @@
 ///
 
 BEGIN_EVENT_TABLE(Grid, wxGrid)
+   EVT_SET_FOCUS(Grid::OnSetFocus)
    EVT_KEY_DOWN(Grid::OnKeyDown)
    EVT_GRID_SELECT_CELL(Grid::OnSelectCell)
 END_EVENT_TABLE()
@@ -374,6 +375,15 @@
 #endif
 }
 
+void Grid::OnSetFocus(wxFocusEvent &event)
+{
+   event.Skip();
+
+#if wxUSE_ACCESSIBILITY
+   mAx->SetCurrentCell(GetGridCursorRow(), GetGridCursorCol());
+#endif
+}
+
 void Grid::OnSelectCell(wxGridEvent &event)
 {
    event.Skip();
@@ -417,6 +427,11 @@
                SetGridCursor(crow, ccol + 1);
             }
          }
+
+#if wxUSE_ACCESSIBILITY
+         // Make sure the new cell is made available to the screen reader
+         mAx->SetCurrentCell(GetGridCursorRow(), GetGridCursorCol());
+#endif
       }
       break;
 
@@ -433,6 +448,7 @@
                           wxNavigationKeyEvent::IsBackward :
                           wxNavigationKeyEvent::IsForward );
             Navigate(flags);
+            return;
          }
          else if (event.ShiftDown()) {
             if (crow == 0 && ccol == 0) {
@@ -459,6 +475,11 @@
             }
          }
          MakeCellVisible(GetGridCursorRow(), GetGridCursorCol());
+
+#if wxUSE_ACCESSIBILITY
+         // Make sure the new cell is made available to the screen reader
+         mAx->SetCurrentCell(GetGridCursorRow(), GetGridCursorCol());
+#endif
       }
       break;
 

Index: Grid.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Grid.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Grid.h      6 Jun 2009 18:05:42 -0000       1.8
+++ Grid.h      12 Jun 2009 02:41:26 -0000      1.9
@@ -199,6 +199,7 @@
 
  protected:
 
+   void OnSetFocus(wxFocusEvent &event);
    void OnSelectCell(wxGridEvent &event);
    void OnKeyDown(wxKeyEvent &event);
 


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to