aboutsummaryrefslogtreecommitdiffstats
path: root/a11y
diff options
context:
space:
mode:
authorTim Wo <tim.wo@sun.com>2003-11-03 12:20:10 +0800
committerGilbert Fang <gilbertfang@src.gnome.org>2003-11-03 12:20:10 +0800
commitd0524e055cfea83de043d0489339577f1848d310 (patch)
tree84fedb72ed7c7cee3f749bb95fa0b62ed1d684fe /a11y
parent77340f152092fb75062229796782860de11bd53e (diff)
downloadgsoc2013-evolution-d0524e055cfea83de043d0489339577f1848d310.tar.gz
gsoc2013-evolution-d0524e055cfea83de043d0489339577f1848d310.tar.zst
gsoc2013-evolution-d0524e055cfea83de043d0489339577f1848d310.zip
new function to deal with grabing table cell focus
2003-10-30 Tim Wo <tim.wo@sun.com> * gal/a11y/e-table/gal-a11y-e-cell.c (eti_grab_focus): new function to deal with grabing table cell focus (eti_atk_component_iface_init): Override "grab_focus" virtual function with eti_grab_focus of AtkComponent interface. (#50131) * gal/e-table/e-cell-text.c: (e_cell_text_class_init): register GalA11yECellText as the a11y implementation for ECellText. svn path=/trunk/; revision=23166
Diffstat (limited to 'a11y')
-rw-r--r--a11y/e-table/gal-a11y-e-cell.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell.c b/a11y/e-table/gal-a11y-e-cell.c
index db4135bf1d..a387c6ed6f 100644
--- a/a11y/e-table/gal-a11y-e-cell.c
+++ b/a11y/e-table/gal-a11y-e-cell.c
@@ -7,6 +7,7 @@
*/
#include <config.h>
+#include "gal/e-table/e-table.h"
#include "gal-a11y-e-cell.h"
#include "gal-a11y-util.h"
#include <atk/atkobject.h>
@@ -112,12 +113,33 @@ eti_get_extents (AtkComponent *component,
*y += yval;
}
+static gboolean
+eti_grab_focus (AtkComponent *component)
+{
+ GalA11yECell *a11y;
+ gint view_row;
+ GtkWidget *e_table, *toplevel;
+
+ a11y = GAL_A11Y_E_CELL (component);
+ e_table = gtk_widget_get_parent (GNOME_CANVAS_ITEM (a11y->item)->canvas);
+ view_row = e_table_view_to_model_row (E_TABLE (e_table), a11y->row);
+
+ e_selection_model_clear (a11y->item->selection);
+ e_selection_model_select_single_row (a11y->item->selection, view_row);
+
+ gtk_widget_grab_focus (e_table);
+ toplevel = gtk_widget_get_toplevel (e_table);
+ if (GTK_WIDGET_TOPLEVEL (toplevel))
+ gtk_window_present (toplevel);
+}
+
/* Table IFace */
static void
eti_atk_component_iface_init (AtkComponentIface *iface)
{
iface->get_extents = eti_get_extents;
+ iface->grab_focus = eti_grab_focus;
}
static void