From: John Darrington Date: Fri, 6 Mar 2009 02:35:47 +0000 (+0900) Subject: Tab key now moves to next row, upon end of line. X-Git-Tag: v0.7.3~252 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=accdc420c2900ef68f2cd77c1a469750b551d5b8;p=pspp-builds.git Tab key now moves to next row, upon end of line. This change alters the behaviour of the tab key in the variable and data sheet. When using the tab key, if the last cell in a row is encountered, it will now cause the active cell to move to the first cell in the next row. Fixes bug #25168 --- diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c index 31ecbcbf..908081e1 100644 --- a/lib/gtk-contrib/psppire-sheet.c +++ b/lib/gtk-contrib/psppire-sheet.c @@ -4204,12 +4204,29 @@ step_sheet (PsppireSheet *sheet, GtkScrollType dir) case GTK_SCROLL_STEP_LEFT: new_cell.col--; break; + case GTK_SCROLL_STEP_FORWARD: + new_cell.col++; + if (new_cell.col >= + psppire_sheet_model_get_column_count (sheet->model)) + { + new_cell.col = 0; + new_cell.row++; + } + break; + case GTK_SCROLL_STEP_BACKWARD: + new_cell.col--; + if (new_cell.col < 0) + { + new_cell.col = + psppire_sheet_model_get_column_count (sheet->model) - 1; + new_cell.row--; + } + break; default: g_assert_not_reached (); break; } - g_signal_emit (sheet, sheet_signals[TRAVERSE], 0, &sheet->active_cell, &new_cell, @@ -4287,10 +4304,14 @@ psppire_sheet_key_press (GtkWidget *widget, switch (key->keyval) { case GDK_Tab: + step_sheet (sheet, GTK_SCROLL_STEP_FORWARD); + break; case GDK_Right: step_sheet (sheet, GTK_SCROLL_STEP_RIGHT); break; case GDK_ISO_Left_Tab: + step_sheet (sheet, GTK_SCROLL_STEP_BACKWARD); + break; case GDK_Left: step_sheet (sheet, GTK_SCROLL_STEP_LEFT); break;