fix problems with combo cell blanking and off by one display

when arrow-key traversing.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@824 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-04-19 08:00:55 +00:00
parent cccbdae8d0
commit a37e7e4368
2 changed files with 24 additions and 6 deletions

View File

@ -211,9 +211,20 @@ xaccSetComboCellValue (ComboCell *cell, const char * str)
} else {
XmComboBoxClearItemSelection (box->combobox);
}
if ((0 < box->currow) && (0 < box->curcol)) {
/* be sure to set the string into the matrix widget as well,
* so that we don't end up blanking out the cell when we
* unmap the combobox widget */
XbaeMatrixSetCell (box->parent, box->currow, box->curcol, (char *) str);
}
} else {
XmComboBoxClearItemSelection (box->combobox);
if ((0 < box->currow) && (0 < box->curcol)) {
XbaeMatrixSetCell (box->parent, box->currow, box->curcol, "");
}
}
}
/* =============================================== */
@ -313,7 +324,6 @@ void moveCombo (BasicCell *bcell, int phys_row, int phys_col)
{
ComboCell *cell;
PopBox *box;
cell = (ComboCell *) bcell;
box = (PopBox *) (cell->cell.gui_private);
@ -448,6 +458,9 @@ static void selectCB (Widget w, XtPointer cd, XtPointer cb )
return;
}
/* be sure to set the string into the matrix widget as well,
* so that we don't end up blanking out the cell when we
* unmap the combobox widget */
XbaeMatrixSetCell (box->parent, box->currow, box->curcol, choice);
SET (&(cell->cell), choice);
XtFree (choice);

View File

@ -439,13 +439,18 @@ void xaccMoveCursorGUI (Table *table, int new_phys_row, int new_phys_col)
cell = curs->cells[i][j];
if (cell) {
char * cell_val = table->entries[i+phys_row_origin][j+phys_col_origin];
xaccSetBasicCellValue (cell, cell_val);
cell->changed = 0;
/* if a cell has a GUI, move that too */
/* if a cell has a GUI, move that first, before setting
* the cell value. Otherwise, we'll end up putting the
* new values in the old cell locations, and that would
* lead to confusion of all sorts. */
if (cell->move) {
(cell->move) (cell, i+phys_row_origin, j+phys_col_origin);
}
/* OK, now set the cell value, after the move */
xaccSetBasicCellValue (cell, cell_val);
cell->changed = 0;
}
}
}
@ -546,7 +551,7 @@ xaccVerifyCursorPosition (Table *table, int phys_row, int phys_col)
if ((virt_row != table->current_cursor_virt_row) ||
(virt_col != table->current_cursor_virt_col)) {
/* before leaving, the current virtual position,
/* before leaving the current virtual position,
* commit any edits that have been accumulated
* in the cursor */
xaccCommitCursor (table);