From 32496628e7268ad257e87a84d97add1239473dfa Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 11 Sep 2000 11:05:31 +0000 Subject: Made page up and page down active in the ETable. 2000-09-11 Christopher James Lahey * e-table.c: Made page up and page down active in the ETable. svn path=/trunk/; revision=5319 --- widgets/e-table/ChangeLog | 4 ++++ widgets/e-table/e-table.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- widgets/table/e-table.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 92 insertions(+), 6 deletions(-) (limited to 'widgets') 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 + + * e-table.c: Made page up and page down active in the ETable. + 2000-09-09 Christopher James Lahey * 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; } -- cgit v1.2.3