diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 2c360b0b2..2aea195aa 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -488,24 +488,18 @@ bool TSpreadsheet::test_focus_change() { bool ok = dirty() != 3; if (ok && _row_dirty) - { - // str2mask(selected()); - // ok = sheet_mask().check_fields(); ok = xi_move_focus(_itf) ? TRUE : FALSE; - } return ok; } -//void TSpreadsheet::xiev_handler(XI_OBJ *itf, XI_EVENT *xiev) -void XVT_CALLCONV1 xiev_handler(XI_OBJ *itf, XI_EVENT *xiev) +HIDDEN void XVT_CALLCONV1 xiev_handler(XI_OBJ *itf, XI_EVENT *xiev) { TSpreadsheet* es = (TSpreadsheet*)xi_get_app_data(itf); CHECK(es, "NULL Edit sheet in xi event"); es->list_handler(xiev); } - // Certified 75% void TSpreadsheet::list_handler(XI_EVENT *xiev) { @@ -672,7 +666,7 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev) if (_check_enabled) { set_pos(xiev->v.xi_obj->v.row, _cur_col); - if (_cur_rec < items()) + if (_cur_rec < items() && notify(_cur_rec, K_TAB)) { str2mask(_cur_rec); _row_dirty = FALSE; @@ -990,14 +984,13 @@ bool TSpreadsheet::on_key(KEY k) k = K_INS; // Inserimento in corso } + notify(n, K_TAB); // Notifica selezione notify(n, K_SPACE); // Notifica inizio cambiamento k = edit(n, k); // Edita riga selezionata o creata if (k == K_ENTER) notify(n, K_ENTER); // Notifica avvenuto cambiamento - xvt_R3_set_front_window(win()); - /* xvt_scr_set_focus_vobj(win()); -- set_focus does not raise window */ - /* xvt_vobj_raise(win()); -- note: raise is illegal on controls */ // Aggiorna sheet a video + xvt_vobj_raise(win()); // Aggiorna sheet a video open(); } break; @@ -1124,17 +1117,22 @@ void TSpreadsheet::enable_column(int col, bool on) { int num; XI_OBJ** columns = xi_get_member_list(_list, &num); - CHECKD(col+1 < num, "Can't enable column ", col); - XI_OBJ* column = columns[col+1]; + for (int c = 1; c < num; c++) + if (columns[c]->cid == FIRST_FIELD+col) + { + XI_OBJ* column = columns[c]; + dword attr = xi_get_attrib(column); + if (on) attr |= XI_ATR_ENABLED; + else attr &= ~XI_ATR_ENABLED; - dword attr = xi_get_attrib(column); - if (on) attr |= XI_ATR_ENABLED; - else attr &= ~XI_ATR_ENABLED; + xi_move_focus(_itf); // Set focus to interface + xi_set_attrib(column, attr); // Set new attributes + RCT r; xi_get_rect(column, &r); + xi_set_column_width(column, (r.right-r.left+1) / CHARX); // Force redraw + + break; + } - xi_move_focus(_itf); // Set focus to interface - xi_set_attrib(column, attr); // Set new attributes - RCT r; xi_get_rect(column, &r); - xi_set_column_width(column, (r.right-r.left+1) / CHARX); // Force redraw } #endif } @@ -1463,11 +1461,14 @@ void TSheet_field::set_getmask(SPREADSHEET_GETMASK n) _sheet->set_getmask( n ); } + +// Certified 50% void TSheet_field::highlight() const { TMask_field::highlight(); #if XVT_OS == XVT_OS_WIN - if (items()) + int rows; xi_get_list_info(_sheet->_list, &rows); + if (rows > 0) { _sheet->_firstfocus = FALSE; if (_sheet->_edit_field == NULL)