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
This commit is contained in:
Linas Vepstas 1998-08-28 04:39:22 +00:00
parent f5c44451fb
commit 5ccc6aec8f
2 changed files with 9 additions and 8 deletions

View File

@ -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; int new_virt_row, new_virt_col;
CellBlock *curs; 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. /* Change the cell background colors to thier "passive" values.
* This denotes that the cursor has left this location (which means more or * 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.") * 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) */ /* check for out-of-bounds conditions (which may be deliberate) */
if ((0 > new_phys_row) || (0 > new_phys_col) || if ((0 > new_phys_row) || (0 > new_phys_col) ||
(new_phys_row >= table->num_phys_rows) || (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; 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_row = -1;
table->current_cursor_phys_col = -1; table->current_cursor_phys_col = -1;
table->current_cursor_virt_row = -1; table->current_cursor_virt_row = -1;

View File

@ -124,7 +124,7 @@ struct _Table {
/* callback that is called when the cursor is moved */ /* callback that is called when the cursor is moved */
/* hack alert -- this should be a callback list, actually */ /* 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; void * client_data;
/* string values for each cell, /* string values for each cell,