Modifiche di Guido

git-svn-id: svn://10.65.10.50/trunk@2055 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-10-31 11:37:59 +00:00
parent b8f59ca129
commit 81d76ac704
2 changed files with 21 additions and 16 deletions

View File

@ -135,7 +135,7 @@ public:
// @cmember Ritorna il contenuto della riga <p n>-esima // @cmember Ritorna il contenuto della riga <p n>-esima
TToken_string& row(int n) TToken_string& row(int n)
{ return _str.row(n); } { return _str.row(n); }
// @cmember Aggiunge una riga allo spreadsheet passata come putatore // @cmember Aggiunge una riga allo spreadsheet passata come puntatore
// (vedi <mf TArray::add>) // (vedi <mf TArray::add>)
int add(const TToken_string& s) int add(const TToken_string& s)
{ return _str.add(s); } { return _str.add(s); }
@ -1820,13 +1820,15 @@ void TSheet_field::highlight() const
{ {
TMask_field::highlight(); TMask_field::highlight();
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
if (_sheet->_check_enabled)
{
int rows; xi_get_list_info(_sheet->_list, &rows); int rows; xi_get_list_info(_sheet->_list, &rows);
if (rows > 0) if (rows > 0)
{ {
_sheet->_firstfocus = FALSE; _sheet->set_focus_cell(_sheet->_cur_row, _sheet->_cur_col);
_sheet->set_focus_cell(_sheet->rec2row(selected()), 1);
_sheet->str2mask(selected()); _sheet->str2mask(selected());
} }
}
#endif #endif
} }

View File

@ -455,13 +455,13 @@ void TSheet::check(
int TSheet::row_to_page(long n) const int TSheet::row_to_page(long n) const
{ {
long i = (n < 0) ? 0L : n-first()+1; long i = (n < 0) ? 0L : n-first()+1;
#ifdef DBG
if (i < 0 || i > visible_rows()) if (i < 0 || i > visible_rows())
{ {
error_box("Line out of screen"); yesnofatal_box("Line out of screen: %ld", n);
i = 0L; i = 1;
} }
#endif
return (int)i; return (int)i;
} }
@ -581,12 +581,15 @@ TToken_string& TSheet::row(
// selezionata. // selezionata.
{ {
if (n < 0) n = selected(); if (n < 0) n = selected();
if (!is_visible(n))
if (!is_visible(n) || _last_update < 0)
{ {
if (_last_update < 0)
set_scroll_max(width(), items());
build_page(n); build_page(n);
set_first(n); set_first(n);
} }
short idx = row_to_page(n); const int idx = row_to_page(n);
return (TToken_string&)_page[idx]; return (TToken_string&)_page[idx];
} }