Commit 79f8f44b authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Round 3 of the great rangesel cursor cleanup

Still some bugs but things are much closer

2001-05-08  Jody Goldberg <jgoldberg@home.com>

	* src/selection.c (sheet_selection_set_internal) : split this out into.
	* src/sheet-merge.c (sheet_merge_find_container) : here.
	* src/sheet-control-gui.c (scg_rangesel_changed) : and here.

2001-05-08  Jody Goldberg <jgoldberg@home.com>

	* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.

	* src/selection.c (sheet_selection_extend) : merge into
	  scg_cursor_extend.

	* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
	  scg_cursor_move.
	(scg_cursor_extend) : merge scg_cursor_extend_[hv]
	(scg_cursor_move) : merge scg_cursor_move_[hv]
	(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
	(scg_rangesel_move) : merge scg_rangesel_move_[hv]
	(scg_rangesel_start) : cleanup.

	* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
	  of Home. Simplify the function pointers for move vs extend by
	  merging horizontal and vertical versions.
parent 08755640
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (sheet_selection_set_internal) : split this out into.
* src/sheet-merge.c (sheet_merge_find_container) : here.
* src/sheet-control-gui.c (scg_rangesel_changed) : and here.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.
* src/selection.c (sheet_selection_extend) : merge into
scg_cursor_extend.
* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
scg_cursor_move.
(scg_cursor_extend) : merge scg_cursor_extend_[hv]
(scg_cursor_move) : merge scg_cursor_move_[hv]
(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
(scg_rangesel_move) : merge scg_rangesel_move_[hv]
(scg_rangesel_start) : cleanup.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
of Home. Simplify the function pointers for move vs extend by
merging horizontal and vertical versions.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
s/scg_stop_range_selection/scg_rangesel_stop/
s/scg_set_cursor_bounds/scg_cursor_bound/
s/scg_cursor_vertical_extend/scg_cursor_extend_v/
s/scg_cursor_horizontal_extend/scg_cursor_extend_h/
s/scg_cursor_vertical_move/scg_cursor_move_v/
s/scg_cursor_horizontal_move/scg_cursor_move_h/
s/scg_cursor_vertical_extend/scg_rangesel_extend_v/
s/scg_cursor_horizontal_extend/scg_rangesel_extend_h/
s/scg_cursor_vertical_move/scg_rangesel_move_v/
s/scg_cursor_horizontal_move/scg_rangesel_move_h/
* src/sheet-control-gui.[ch] : Move the rangesel info from
gnumeric-sheet into here in preparation for panes.
(scg_rangesel_extend_v) : merge content from
gnumeric-sheet equivalent.
(scg_rangesel_extend_h) : ditto.
(scg_rangesel_move_v) : ditto.
(scg_rangesel_move_h) : ditto.
(scg_rangesel_start) : ditto.
(scg_rangesel_stop) : ditto.
(start_range_selection) : moved from gnumeric-sheet.
(scg_rangesel_possible) : renamed from
gnumeric_sheet_can_select_expr_range.
(scg_rangesel_changed) : renamed from scg_range_selection_changed
and make this the point that rationalizes the cursor points.
(scg_cursor_bound) : renamed from scg_set_cursor_bounds
and make this the point that raionalizes the cursor points.
(scg_ant) : changes to item_cursor_set_bounds.
(scg_colrow_select) : rangesel support is now in scg.
(scg_select_all) : ditto.
* src/workbook-edit.c : cleanup includes.
* src/item-grid.c (item_grid_event) : rangesel support is now in scg.
(item_grid_button_1) : ditto.
* src/item-cursor.h : privatize the structure and class.
* src/item-cursor.c (cb_autofill_scroll) : changes to
item_cursor_set_bounds_visibly signature.
(cb_move_cursor) : ditto.
(item_cursor_set_bounds_visibly) : changes to item_cursor_set_bounds
signature.
(item_cursor_selection_event) : ditto.
(item_cursor_set_bounds) : simplify.
* src/item-bar.c (is_pointer_on_division) : rangesel support is now in scg.
* src/gnumeric-sheet.[ch] : move the rangesel logic up into scg.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
From Juan Pablo Mendoza <pablo_juan@yahoo.com>
* src/sheet.c: (sheet_clone_colrow_info): Clone col and row
default size.
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/colrow.c (colrow_restore_sizes_group): Restore
......
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (sheet_selection_set_internal) : split this out into.
* src/sheet-merge.c (sheet_merge_find_container) : here.
* src/sheet-control-gui.c (scg_rangesel_changed) : and here.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.
* src/selection.c (sheet_selection_extend) : merge into
scg_cursor_extend.
* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
scg_cursor_move.
(scg_cursor_extend) : merge scg_cursor_extend_[hv]
(scg_cursor_move) : merge scg_cursor_move_[hv]
(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
(scg_rangesel_move) : merge scg_rangesel_move_[hv]
(scg_rangesel_start) : cleanup.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
of Home. Simplify the function pointers for move vs extend by
merging horizontal and vertical versions.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
s/scg_stop_range_selection/scg_rangesel_stop/
s/scg_set_cursor_bounds/scg_cursor_bound/
s/scg_cursor_vertical_extend/scg_cursor_extend_v/
s/scg_cursor_horizontal_extend/scg_cursor_extend_h/
s/scg_cursor_vertical_move/scg_cursor_move_v/
s/scg_cursor_horizontal_move/scg_cursor_move_h/
s/scg_cursor_vertical_extend/scg_rangesel_extend_v/
s/scg_cursor_horizontal_extend/scg_rangesel_extend_h/
s/scg_cursor_vertical_move/scg_rangesel_move_v/
s/scg_cursor_horizontal_move/scg_rangesel_move_h/
* src/sheet-control-gui.[ch] : Move the rangesel info from
gnumeric-sheet into here in preparation for panes.
(scg_rangesel_extend_v) : merge content from
gnumeric-sheet equivalent.
(scg_rangesel_extend_h) : ditto.
(scg_rangesel_move_v) : ditto.
(scg_rangesel_move_h) : ditto.
(scg_rangesel_start) : ditto.
(scg_rangesel_stop) : ditto.
(start_range_selection) : moved from gnumeric-sheet.
(scg_rangesel_possible) : renamed from
gnumeric_sheet_can_select_expr_range.
(scg_rangesel_changed) : renamed from scg_range_selection_changed
and make this the point that rationalizes the cursor points.
(scg_cursor_bound) : renamed from scg_set_cursor_bounds
and make this the point that raionalizes the cursor points.
(scg_ant) : changes to item_cursor_set_bounds.
(scg_colrow_select) : rangesel support is now in scg.
(scg_select_all) : ditto.
* src/workbook-edit.c : cleanup includes.
* src/item-grid.c (item_grid_event) : rangesel support is now in scg.
(item_grid_button_1) : ditto.
* src/item-cursor.h : privatize the structure and class.
* src/item-cursor.c (cb_autofill_scroll) : changes to
item_cursor_set_bounds_visibly signature.
(cb_move_cursor) : ditto.
(item_cursor_set_bounds_visibly) : changes to item_cursor_set_bounds
signature.
(item_cursor_selection_event) : ditto.
(item_cursor_set_bounds) : simplify.
* src/item-bar.c (is_pointer_on_division) : rangesel support is now in scg.
* src/gnumeric-sheet.[ch] : move the rangesel logic up into scg.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
From Juan Pablo Mendoza <pablo_juan@yahoo.com>
* src/sheet.c: (sheet_clone_colrow_info): Clone col and row
default size.
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/colrow.c (colrow_restore_sizes_group): Restore
......
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (sheet_selection_set_internal) : split this out into.
* src/sheet-merge.c (sheet_merge_find_container) : here.
* src/sheet-control-gui.c (scg_rangesel_changed) : and here.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.
* src/selection.c (sheet_selection_extend) : merge into
scg_cursor_extend.
* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
scg_cursor_move.
(scg_cursor_extend) : merge scg_cursor_extend_[hv]
(scg_cursor_move) : merge scg_cursor_move_[hv]
(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
(scg_rangesel_move) : merge scg_rangesel_move_[hv]
(scg_rangesel_start) : cleanup.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
of Home. Simplify the function pointers for move vs extend by
merging horizontal and vertical versions.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
s/scg_stop_range_selection/scg_rangesel_stop/
s/scg_set_cursor_bounds/scg_cursor_bound/
s/scg_cursor_vertical_extend/scg_cursor_extend_v/
s/scg_cursor_horizontal_extend/scg_cursor_extend_h/
s/scg_cursor_vertical_move/scg_cursor_move_v/
s/scg_cursor_horizontal_move/scg_cursor_move_h/
s/scg_cursor_vertical_extend/scg_rangesel_extend_v/
s/scg_cursor_horizontal_extend/scg_rangesel_extend_h/
s/scg_cursor_vertical_move/scg_rangesel_move_v/
s/scg_cursor_horizontal_move/scg_rangesel_move_h/
* src/sheet-control-gui.[ch] : Move the rangesel info from
gnumeric-sheet into here in preparation for panes.
(scg_rangesel_extend_v) : merge content from
gnumeric-sheet equivalent.
(scg_rangesel_extend_h) : ditto.
(scg_rangesel_move_v) : ditto.
(scg_rangesel_move_h) : ditto.
(scg_rangesel_start) : ditto.
(scg_rangesel_stop) : ditto.
(start_range_selection) : moved from gnumeric-sheet.
(scg_rangesel_possible) : renamed from
gnumeric_sheet_can_select_expr_range.
(scg_rangesel_changed) : renamed from scg_range_selection_changed
and make this the point that rationalizes the cursor points.
(scg_cursor_bound) : renamed from scg_set_cursor_bounds
and make this the point that raionalizes the cursor points.
(scg_ant) : changes to item_cursor_set_bounds.
(scg_colrow_select) : rangesel support is now in scg.
(scg_select_all) : ditto.
* src/workbook-edit.c : cleanup includes.
* src/item-grid.c (item_grid_event) : rangesel support is now in scg.
(item_grid_button_1) : ditto.
* src/item-cursor.h : privatize the structure and class.
* src/item-cursor.c (cb_autofill_scroll) : changes to
item_cursor_set_bounds_visibly signature.
(cb_move_cursor) : ditto.
(item_cursor_set_bounds_visibly) : changes to item_cursor_set_bounds
signature.
(item_cursor_selection_event) : ditto.
(item_cursor_set_bounds) : simplify.
* src/item-bar.c (is_pointer_on_division) : rangesel support is now in scg.
* src/gnumeric-sheet.[ch] : move the rangesel logic up into scg.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
From Juan Pablo Mendoza <pablo_juan@yahoo.com>
* src/sheet.c: (sheet_clone_colrow_info): Clone col and row
default size.
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/colrow.c (colrow_restore_sizes_group): Restore
......
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (sheet_selection_set_internal) : split this out into.
* src/sheet-merge.c (sheet_merge_find_container) : here.
* src/sheet-control-gui.c (scg_rangesel_changed) : and here.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.
* src/selection.c (sheet_selection_extend) : merge into
scg_cursor_extend.
* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
scg_cursor_move.
(scg_cursor_extend) : merge scg_cursor_extend_[hv]
(scg_cursor_move) : merge scg_cursor_move_[hv]
(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
(scg_rangesel_move) : merge scg_rangesel_move_[hv]
(scg_rangesel_start) : cleanup.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
of Home. Simplify the function pointers for move vs extend by
merging horizontal and vertical versions.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
s/scg_stop_range_selection/scg_rangesel_stop/
s/scg_set_cursor_bounds/scg_cursor_bound/
s/scg_cursor_vertical_extend/scg_cursor_extend_v/
s/scg_cursor_horizontal_extend/scg_cursor_extend_h/
s/scg_cursor_vertical_move/scg_cursor_move_v/
s/scg_cursor_horizontal_move/scg_cursor_move_h/
s/scg_cursor_vertical_extend/scg_rangesel_extend_v/
s/scg_cursor_horizontal_extend/scg_rangesel_extend_h/
s/scg_cursor_vertical_move/scg_rangesel_move_v/
s/scg_cursor_horizontal_move/scg_rangesel_move_h/
* src/sheet-control-gui.[ch] : Move the rangesel info from
gnumeric-sheet into here in preparation for panes.
(scg_rangesel_extend_v) : merge content from
gnumeric-sheet equivalent.
(scg_rangesel_extend_h) : ditto.
(scg_rangesel_move_v) : ditto.
(scg_rangesel_move_h) : ditto.
(scg_rangesel_start) : ditto.
(scg_rangesel_stop) : ditto.
(start_range_selection) : moved from gnumeric-sheet.
(scg_rangesel_possible) : renamed from
gnumeric_sheet_can_select_expr_range.
(scg_rangesel_changed) : renamed from scg_range_selection_changed
and make this the point that rationalizes the cursor points.
(scg_cursor_bound) : renamed from scg_set_cursor_bounds
and make this the point that raionalizes the cursor points.
(scg_ant) : changes to item_cursor_set_bounds.
(scg_colrow_select) : rangesel support is now in scg.
(scg_select_all) : ditto.
* src/workbook-edit.c : cleanup includes.
* src/item-grid.c (item_grid_event) : rangesel support is now in scg.
(item_grid_button_1) : ditto.
* src/item-cursor.h : privatize the structure and class.
* src/item-cursor.c (cb_autofill_scroll) : changes to
item_cursor_set_bounds_visibly signature.
(cb_move_cursor) : ditto.
(item_cursor_set_bounds_visibly) : changes to item_cursor_set_bounds
signature.
(item_cursor_selection_event) : ditto.
(item_cursor_set_bounds) : simplify.
* src/item-bar.c (is_pointer_on_division) : rangesel support is now in scg.
* src/gnumeric-sheet.[ch] : move the rangesel logic up into scg.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
From Juan Pablo Mendoza <pablo_juan@yahoo.com>
* src/sheet.c: (sheet_clone_colrow_info): Clone col and row
default size.
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/colrow.c (colrow_restore_sizes_group): Restore
......
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (sheet_selection_set_internal) : split this out into.
* src/sheet-merge.c (sheet_merge_find_container) : here.
* src/sheet-control-gui.c (scg_rangesel_changed) : and here.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_read_selection_info) : Use sheet_set_edit_pos.
* src/selection.c (sheet_selection_extend) : merge into
scg_cursor_extend.
* src/sheet-control-gui.c (scg_cursor_move_to) : rename from
scg_cursor_move.
(scg_cursor_extend) : merge scg_cursor_extend_[hv]
(scg_cursor_move) : merge scg_cursor_move_[hv]
(scg_rangesel_extend) : merge scg_rangesel_extend_[hv]
(scg_rangesel_move) : merge scg_rangesel_move_[hv]
(scg_rangesel_start) : cleanup.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : fix handling
of Home. Simplify the function pointers for move vs extend by
merging horizontal and vertical versions.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
s/scg_stop_range_selection/scg_rangesel_stop/
s/scg_set_cursor_bounds/scg_cursor_bound/
s/scg_cursor_vertical_extend/scg_cursor_extend_v/
s/scg_cursor_horizontal_extend/scg_cursor_extend_h/
s/scg_cursor_vertical_move/scg_cursor_move_v/
s/scg_cursor_horizontal_move/scg_cursor_move_h/
s/scg_cursor_vertical_extend/scg_rangesel_extend_v/
s/scg_cursor_horizontal_extend/scg_rangesel_extend_h/
s/scg_cursor_vertical_move/scg_rangesel_move_v/
s/scg_cursor_horizontal_move/scg_rangesel_move_h/
* src/sheet-control-gui.[ch] : Move the rangesel info from
gnumeric-sheet into here in preparation for panes.
(scg_rangesel_extend_v) : merge content from
gnumeric-sheet equivalent.
(scg_rangesel_extend_h) : ditto.
(scg_rangesel_move_v) : ditto.
(scg_rangesel_move_h) : ditto.
(scg_rangesel_start) : ditto.
(scg_rangesel_stop) : ditto.
(start_range_selection) : moved from gnumeric-sheet.
(scg_rangesel_possible) : renamed from
gnumeric_sheet_can_select_expr_range.
(scg_rangesel_changed) : renamed from scg_range_selection_changed
and make this the point that rationalizes the cursor points.
(scg_cursor_bound) : renamed from scg_set_cursor_bounds
and make this the point that raionalizes the cursor points.
(scg_ant) : changes to item_cursor_set_bounds.
(scg_colrow_select) : rangesel support is now in scg.
(scg_select_all) : ditto.
* src/workbook-edit.c : cleanup includes.
* src/item-grid.c (item_grid_event) : rangesel support is now in scg.
(item_grid_button_1) : ditto.
* src/item-cursor.h : privatize the structure and class.
* src/item-cursor.c (cb_autofill_scroll) : changes to
item_cursor_set_bounds_visibly signature.
(cb_move_cursor) : ditto.
(item_cursor_set_bounds_visibly) : changes to item_cursor_set_bounds
signature.
(item_cursor_selection_event) : ditto.
(item_cursor_set_bounds) : simplify.
* src/item-bar.c (is_pointer_on_division) : rangesel support is now in scg.
* src/gnumeric-sheet.[ch] : move the rangesel logic up into scg.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
From Juan Pablo Mendoza <pablo_juan@yahoo.com>
* src/sheet.c: (sheet_clone_colrow_info): Clone col and row
default size.
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/colrow.c (colrow_restore_sizes_group): Restore
......
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* numtheory.c (WORD_BIT) : suppress warning.
2001-03-17 Jody Goldberg <jgoldberg@home.com>
* Release 0.64
......
......@@ -21,7 +21,7 @@
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
#ifndef WORD_BIT
#define WORD_BIT (sizeof (int) * CHAR_BIT)
#define WORD_BIT ((int)(sizeof (int) * CHAR_BIT))
#endif
#define OUT_OF_BOUNDS "#LIMIT!"
......
......@@ -110,7 +110,7 @@ Sheet_cursor_set (PortableServer_Servant servant,
verify ((base_row >= start_row) && (base_row <= end_row) &&
(base_col >= start_col) && (base_col <= end_col));
sheet_cursor_set (sheet, base_col, base_row, start_col, start_row, end_col, end_row);
sheet_selection_set (sheet, base_col, base_row, start_col, start_row, end_col, end_row);
}
static void
......@@ -121,7 +121,7 @@ Sheet_cursor_move (PortableServer_Servant servant, const CORBA_long col, const C
verify_col (col);
verify_row (row);
sheet_cursor_set (sheet, col, row, col, row, col, row);
sheet_selection_set (sheet, col, row, col, row, col, row);
}
static void
......
......@@ -53,9 +53,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
{
Sheet *sheet = gsheet->scg->sheet;
WorkbookControlGUI *wbcg = gsheet->scg->wbcg;
void (*movefn_horizontal) (SheetControlGUI *, int, gboolean);
void (*movefn_vertical) (SheetControlGUI *, int, gboolean);
gboolean const jump_to_bounds = event->state & GDK_CONTROL_MASK;
void (*movefn) (SheetControlGUI *, int n,
gboolean jump, gboolean horiz);
/* Magic : Some of these are accelerators,
* we need to catch them before entering because they appear to be printable
......@@ -73,42 +73,34 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
return 1;
}
if (event->state & GDK_SHIFT_MASK) {
movefn_horizontal = scg_rangesel_extend_h;
movefn_vertical = scg_rangesel_extend_v;
} else {
movefn_horizontal = scg_rangesel_move_h;
movefn_vertical = scg_rangesel_move_v;
}
movefn = (event->state & GDK_SHIFT_MASK)
? scg_rangesel_extend
: scg_rangesel_move;
} else {
if (event->state & GDK_SHIFT_MASK) {
movefn_horizontal = scg_cursor_extend_h;
movefn_vertical = scg_cursor_extend_v;
} else {
movefn_horizontal = scg_cursor_move_h;
movefn_vertical = scg_cursor_move_v;
}
movefn = (event->state & GDK_SHIFT_MASK)
? scg_cursor_extend
: scg_cursor_move;
}
switch (event->keyval) {
case GDK_KP_Left:
case GDK_Left:
(*movefn_horizontal)(gsheet->scg, -1, jump_to_bounds);
(*movefn) (gsheet->scg, -1, jump_to_bounds, TRUE);
break;
case GDK_KP_Right:
case GDK_Right:
(*movefn_horizontal)(gsheet->scg, 1, jump_to_bounds);
(*movefn) (gsheet->scg, 1, jump_to_bounds, TRUE);
break;
case GDK_KP_Up:
case GDK_Up:
(*movefn_vertical)(gsheet->scg, -1, jump_to_bounds);
(*movefn) (gsheet->scg, -1, jump_to_bounds, FALSE);
break;
case GDK_KP_Down:
case GDK_Down:
(*movefn_vertical)(gsheet->scg, 1, jump_to_bounds);
(*movefn) (gsheet->scg, 1, jump_to_bounds, FALSE);
break;
case GDK_KP_Page_Up:
......@@ -116,15 +108,13 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0)
gtk_notebook_prev_page (wbcg->notebook);
else if ((event->state & GDK_MOD1_MASK) == 0)
(*movefn_vertical)(
gsheet->scg,
-(gsheet->row.last_visible-gsheet->row.first),
FALSE);
(*movefn)( gsheet->scg,
-(gsheet->row.last_visible-gsheet->row.first),
FALSE, FALSE);
else
(*movefn_horizontal)(
gsheet->scg,
-(gsheet->col.last_visible-gsheet->col.first),
FALSE);
(*movefn)(gsheet->scg,
-(gsheet->col.last_visible-gsheet->col.first),
FALSE, TRUE);
break;
case GDK_KP_Page_Down:
......@@ -132,24 +122,21 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0)
gtk_notebook_next_page (wbcg->notebook);
else if ((event->state & GDK_MOD1_MASK) == 0)
(*movefn_vertical)(
gsheet->scg,
gsheet->row.last_visible-gsheet->row.first,
FALSE);
(*movefn)(gsheet->scg,
gsheet->row.last_visible-gsheet->row.first,
FALSE, FALSE);
else
(*movefn_horizontal)(
gsheet->scg,
gsheet->col.last_visible-gsheet->col.first,
FALSE);
(*movefn)(gsheet->scg,
gsheet->col.last_visible-gsheet->col.first,
FALSE, TRUE);
break;
case GDK_KP_Home:
case GDK_Home:
if ((event->state & GDK_CONTROL_MASK) != 0)
scg_cursor_move (gsheet->scg, 0, 0, TRUE);
else
(*movefn_horizontal)(
gsheet->scg, -sheet->edit_pos.col, FALSE);
/* do the ctrl-home jump to A1 in 2 steps */
(*movefn)(gsheet->scg, -SHEET_MAX_COLS, FALSE, TRUE);
if ((event->state & GDK_CONTROL_MASK))
(*movefn)(gsheet->scg, -SHEET_MAX_ROWS, FALSE, FALSE);
break;
case GDK_KP_Delete:
......
......@@ -53,9 +53,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
{
Sheet *sheet = gsheet->scg->sheet;
WorkbookControlGUI *wbcg = gsheet->scg->wbcg;
void (*movefn_horizontal) (SheetControlGUI *, int, gboolean);
void (*movefn_vertical) (SheetControlGUI *, int, gboolean);
gboolean const jump_to_bounds = event->state & GDK_CONTROL_MASK;
void (*movefn) (SheetControlGUI *, int n,
gboolean jump, gboolean horiz);
/* Magic : Some of these are accelerators,
* we need to catch them before entering because they appear to be printable
......@@ -73,42 +73,34 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
return 1;
}
if (event->state & GDK_SHIFT_MASK) {
movefn_horizontal = scg_rangesel_extend_h;
movefn_vertical = scg_rangesel_extend_v;
} else {
movefn_horizontal = scg_rangesel_move_h;
movefn_vertical = scg_rangesel_move_v;
}
movefn = (event->state & GDK_SHIFT_MASK)
? scg_rangesel_extend
: scg_rangesel_move;
} else {
if (event->state & GDK_SHIFT_MASK) {
movefn_horizontal = scg_cursor_extend_h;
movefn_vertical = scg_cursor_extend_v;
} else {
movefn_horizontal = scg_cursor_move_h;
movefn_vertical = scg_cursor_move_v;
}
movefn = (event->state & GDK_SHIFT_MASK)
? scg_cursor_extend
: scg_cursor_move;
}
switch (event->keyval) {
case GDK_KP_Left:
case GDK_Left:
(*movefn_horizontal)(gsheet->scg, -1, jump_to_bounds);
(*movefn) (gsheet->scg, -1, jump_to_bounds, TRUE);
break;
case GDK_KP_Right:
case GDK_Right:
(*movefn_horizontal)(gsheet->scg, 1, jump_to_bounds);
(*movefn) (gsheet->scg, 1, jump_to_bounds, TRUE);
break;
case GDK_KP_Up:
case GDK_Up:
(*movefn_vertical)(gsheet->scg, -1, jump_to_bounds);
(*movefn) (gsheet->scg, -1, jump_to_bounds, FALSE);
break;
case GDK_KP_Down:
case GDK_Down:
(*movefn_vertical)(gsheet->scg, 1, jump_to_bounds);
(*movefn) (gsheet->scg, 1, jump_to_bounds, FALSE);
break;
case GDK_KP_Page_Up:
......@@ -116,15 +108,13 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0)
gtk_notebook_prev_page (wbcg->notebook);
else if ((event->state & GDK_MOD1_MASK) == 0)
(*movefn_vertical)(
gsheet->scg,
-(gsheet->row.last_visible-gsheet->row.first),
FALSE);
(*movefn)( gsheet->scg,
-(gsheet->row.last_visible-gsheet->row.first),
FALSE, FALSE);
else
(*movefn_horizontal)(
gsheet->scg,
-(gsheet->col.last_visible-gsheet->col.first),
FALSE);
(*movefn)(gsheet->scg,
-(gsheet->col.last_visible-gsheet->col.first),
FALSE, TRUE);
break;
case GDK_KP_Page_Down:
......@@ -132,24 +122,21 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0)
gtk_notebook_next_page (wbcg->notebook);
else if ((event->state & GDK_MOD1_MASK) == 0)
(*movefn_vertical)(
gsheet->scg,
gsheet->row.last_visible-gsheet->row.first,
FALSE);
(*movefn)(gsheet->scg,
gsheet->row.last_visible-gsheet->row.first,
FALSE, FALSE);
else
(*movefn_horizontal)(
gsheet->scg,
gsheet->col.last_visible-gsheet->col.first,
FALSE);
(*movefn)(gsheet->scg,
gsheet->col.last_visible-gsheet->col.first,
FALSE, TRUE);
break;