Corretta correzione precedente

git-svn-id: svn://10.65.10.50/trunk@2482 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-01-22 11:07:49 +00:00
parent 1d3b9b7826
commit 1c0919a4ba

View File

@ -631,24 +631,17 @@ int TSpreadsheet::find_enabled_column(int rec, int colonna, int direction) const
// riga (da 0), colonna (0 = numero, 1 = prima cella, ...)
void TSpreadsheet::set_focus_cell(int riga, int colonna)
{
const bool has_focus = mask().focus_field().dlg() == _owner->dlg();
if (has_focus)
{
xvt_scr_set_focus_vobj(win());
mask().set_focus_win(win(), FALSE);
}
xvt_scr_set_focus_vobj(win());
mask().set_focus_win(win(), FALSE);
const int rec = row2rec(riga);
colonna = find_enabled_column(rec, colonna, +1);
if (colonna > 0)
{
if (has_focus)
{
XI_OBJ cell;
XI_MAKE_CELL(&cell, _list, riga, colonna);
xi_set_focus(&cell);
}
XI_OBJ cell;
XI_MAKE_CELL(&cell, _list, riga, colonna);
xi_set_focus(&cell);
_edit_field = col2field(_cur_col = colonna);
if (rec != _cur_rec)
@ -1274,8 +1267,20 @@ void TSpreadsheet::select(int rec, bool scrollto)
xi_scroll_rec(_list, rec, NORMAL_COLOR, XI_ATR_ENABLED | XI_ATR_AUTOSELECT, 0);
const int row = rec2row(rec);
_cur_rec = -1;
set_focus_cell(row, 1);
const bool has_focus = mask().focus_field().dlg() == _owner->dlg();
if (has_focus)
{
_cur_rec = -1;
set_focus_cell(row, 1);
}
else
{
_edit_field = col2field(_cur_col = 1);
_cur_rec = rec;
_cur_row = row;
str2mask(_cur_rec);
_row_dirty = FALSE;
}
notify(rec, K_TAB);
}