From 5ccc6aec8f931446a9bcdcd4ea6198961e55b2ca Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Fri, 28 Aug 1998 04:39:22 +0000 Subject: [PATCH] add more arguments to the move-cursor callback git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1051 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/register/table-allgui.c | 15 ++++++++------- src/register/table-allgui.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/register/table-allgui.c b/src/register/table-allgui.c index 24115580bc..30f35abfd8 100644 --- a/src/register/table-allgui.c +++ b/src/register/table-allgui.c @@ -335,12 +335,6 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col, int do_move_gui) int new_virt_row, new_virt_col; CellBlock *curs; - /* call the callback, allowing the app to commit any changes - * associated with the current location of the cursor. */ - if (table->move_cursor) { - (table->move_cursor) (table, table->client_data); - } - /* Change the cell background colors to thier "passive" values. * This denotes that the cursor has left this location (which means more or * less the same thing as "the current location is no longer being edited.") @@ -367,6 +361,13 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col, int do_move_gui) } } + /* call the callback, allowing the app to commit any changes + * associated with the current location of the cursor. */ + if (table->move_cursor) { + (table->move_cursor) (table, new_phys_row, new_phys_col, + table->client_data); + } + /* check for out-of-bounds conditions (which may be deliberate) */ if ((0 > new_phys_row) || (0 > new_phys_col) || (new_phys_row >= table->num_phys_rows) || @@ -378,7 +379,7 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col, int do_move_gui) new_virt_col = table->locators[new_phys_row][new_phys_col]->virt_col; } - /* invalidate the cursor for now; we'll set it the the correct values below */ + /* invalidate the cursor for now; we'll fix it back up below */ table->current_cursor_phys_row = -1; table->current_cursor_phys_col = -1; table->current_cursor_virt_row = -1; diff --git a/src/register/table-allgui.h b/src/register/table-allgui.h index a3472e5e54..916d05e5ef 100644 --- a/src/register/table-allgui.h +++ b/src/register/table-allgui.h @@ -124,7 +124,7 @@ struct _Table { /* callback that is called when the cursor is moved */ /* hack alert -- this should be a callback list, actually */ - void (*move_cursor) (Table *, void *client_data); + void (*move_cursor) (Table *, int new_phys_row, int new_phys_col, void *client_data); void * client_data; /* string values for each cell,