diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 49d0e0fb6..a7e1313cc 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -10,12 +10,6 @@ const short FIRST_FIELD = 101; #include #include -extern "C" -{ -#include -} - - /////////////////////////////////////////////////////////// // TSpreadsheet /////////////////////////////////////////////////////////// @@ -213,7 +207,7 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy, 0, 0, rct.bottom-rct.top, XI_ATR_ENABLED | XI_ATR_VISIBLE, NORMAL_COLOR, NORMAL_BACK_COLOR, // normal - NORMAL_COLOR, MASK_BACK_COLOR, // disabled + NORMAL_COLOR, DISABLED_BACK_COLOR, // disabled COLOR_RED, // active LIST_CID); listdef->v.list->sizable_columns = TRUE; @@ -384,7 +378,7 @@ void TSpreadsheet::update_rec(int rec) { XI_OBJ row; XI_MAKE_ROW(&row, _list, riga); - xi_cell_request(&row); // Update internal values + xi_cell_request(&row); // Update internal values if (_update) xi_set_row_height(&row, CHARY+1); // Force row updating } @@ -420,9 +414,11 @@ void TSpreadsheet::set_focus_cell(int riga, int colonna) int TSpreadsheet::insert(int rec) -{ - const int r = _str.insert(new TToken_string(80), rec); +{ + if (items() >= 999) + return -1; + const int r = _str.insert(new TToken_string(80), rec); const bool ok = notify(r, K_INS); if (!ok) @@ -1147,7 +1143,9 @@ void TSpreadsheet::str2mask(int riga) { TMask_field& f = sheet_mask().fld(i); const short id = f.dlg(); - if (id >= FIRST_FIELD && (f.active() || f.ghost())) + if (id >= FIRST_FIELD && + f.class_id() != CLASS_BUTTON_FIELD && + (f.active() || f.ghost())) { if (f.has_check()) f.check(STARTING_CHECK); @@ -1194,9 +1192,7 @@ KEY TSpreadsheet::edit(int n, KEY tasto) if (k == K_ENTER) { -#if XVT_OS != XVT_OS_WIN mask2str(n); -#endif } else if (k == K_DEL) {