aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-09-11 19:05:31 +0800
committerChris Lahey <clahey@src.gnome.org>2000-09-11 19:05:31 +0800
commit32496628e7268ad257e87a84d97add1239473dfa (patch)
treed5b6699e617e49bb3ef46a8c424c12f7e95f8c1f
parent5a5346ed56725e2647f8719c4bc504a0005a662d (diff)
downloadgsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar.gz
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar.bz2
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar.lz
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar.xz
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.tar.zst
gsoc2013-evolution-32496628e7268ad257e87a84d97add1239473dfa.zip
Made page up and page down active in the ETable.
2000-09-11 Christopher James Lahey <clahey@helixcode.com> * e-table.c: Made page up and page down active in the ETable. svn path=/trunk/; revision=5319
-rw-r--r--widgets/e-table/ChangeLog4
-rw-r--r--widgets/e-table/e-table.c47
-rw-r--r--widgets/table/e-table.c47
3 files changed, 92 insertions, 6 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 8cbe7ff511..b7071d0461 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,7 @@
+2000-09-11 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-table.c: Made page up and page down active in the ETable.
+
2000-09-09 Christopher James Lahey <clahey@helixcode.com>
* e-tree-simple.c: Fixed the ETableModel callbacks.
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index 1a2a3cd8d6..b40d7e4df8 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -335,9 +335,50 @@ static gint
group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
{
int return_val = 0;
- gtk_signal_emit (GTK_OBJECT (et),
- et_signals [KEY_PRESS],
- row, col, event, &return_val);
+ GdkEventKey *key = (GdkEventKey *) event;
+ GdkEventButton click;
+ switch (key->keyval) {
+ case GDK_Page_Down:
+ gtk_adjustment_set_value(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas)),
+ CLAMP(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->value +
+ (gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 20),
+ 0,
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->upper -
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size));
+ click.type = GDK_BUTTON_PRESS;
+ click.window = GTK_LAYOUT (et->table_canvas)->bin_window;
+ click.send_event = key->send_event;
+ click.time = key->time;
+ click.x = 30;
+ click.y = gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 1;
+ click.state = key->state;
+ click.button = 1;
+ gtk_widget_event(GTK_WIDGET(et->table_canvas),
+ (GdkEvent *) &click);
+ return_val = 1;
+ break;
+ case GDK_Page_Up:
+ gtk_adjustment_set_value(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas)),
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->value -
+ (gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 20));
+ click.type = GDK_BUTTON_PRESS;
+ click.window = GTK_LAYOUT (et->table_canvas)->bin_window;
+ click.send_event = key->send_event;
+ click.time = key->time;
+ click.x = 30;
+ click.y = 1;
+ click.state = key->state;
+ click.button = 1;
+ gtk_widget_event(GTK_WIDGET(et->table_canvas),
+ (GdkEvent *) &click);
+ return_val = 1;
+ break;
+ default:
+ gtk_signal_emit (GTK_OBJECT (et),
+ et_signals [KEY_PRESS],
+ row, col, event, &return_val);
+ break;
+ }
return return_val;
}
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 1a2a3cd8d6..b40d7e4df8 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -335,9 +335,50 @@ static gint
group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
{
int return_val = 0;
- gtk_signal_emit (GTK_OBJECT (et),
- et_signals [KEY_PRESS],
- row, col, event, &return_val);
+ GdkEventKey *key = (GdkEventKey *) event;
+ GdkEventButton click;
+ switch (key->keyval) {
+ case GDK_Page_Down:
+ gtk_adjustment_set_value(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas)),
+ CLAMP(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->value +
+ (gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 20),
+ 0,
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->upper -
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size));
+ click.type = GDK_BUTTON_PRESS;
+ click.window = GTK_LAYOUT (et->table_canvas)->bin_window;
+ click.send_event = key->send_event;
+ click.time = key->time;
+ click.x = 30;
+ click.y = gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 1;
+ click.state = key->state;
+ click.button = 1;
+ gtk_widget_event(GTK_WIDGET(et->table_canvas),
+ (GdkEvent *) &click);
+ return_val = 1;
+ break;
+ case GDK_Page_Up:
+ gtk_adjustment_set_value(gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas)),
+ gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->value -
+ (gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas))->page_size - 20));
+ click.type = GDK_BUTTON_PRESS;
+ click.window = GTK_LAYOUT (et->table_canvas)->bin_window;
+ click.send_event = key->send_event;
+ click.time = key->time;
+ click.x = 30;
+ click.y = 1;
+ click.state = key->state;
+ click.button = 1;
+ gtk_widget_event(GTK_WIDGET(et->table_canvas),
+ (GdkEvent *) &click);
+ return_val = 1;
+ break;
+ default:
+ gtk_signal_emit (GTK_OBJECT (et),
+ et_signals [KEY_PRESS],
+ row, col, event, &return_val);
+ break;
+ }
return return_val;
}