diff --git a/include/msksheet.cpp b/include/msksheet.cpp index d6a6346bb..c30a6e693 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -707,6 +707,30 @@ break; } } +void TSpreadsheet::enable(bool on) +{ + const dword old = xi_get_attrib(_list); + const dword att = on ? (old & ~XI_ATR_NAVIGATE) : (old | XI_ATR_NAVIGATE); + if (old != att) + { + int num; + XI_OBJ** columns = xi_get_member_list(_list, &num); + + xi_move_focus(_itf); // Set focus to interface + xi_set_attrib(_list, att); + + att = on ? (att | XI_ATR_TABWRAP) : (att & ~XI_ATR_TABWRAP); + for (int col = 1; col < num; col++) + { + XI_OBJ* column = columns[col]; + dword attr = xi_get_attrib(column); + if (on) attr &= ~XI_ATR_READONLY; + else attr |= XI_ATR_READONLY; + xi_set_attrib(column, attr); // Set new attributes + } + } +} + int TSpreadsheet::add(TToken_string& t) { return _str.add(t); @@ -760,6 +784,7 @@ public: void enable_column(int col, bool on); void enable_cell(int row, int column, bool on = TRUE); bool cell_disabled(int row, int column) const; + virtual ~TSpreadsheet() {} }; TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy, @@ -767,7 +792,7 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy, const char* head, WINDOW parent, TSheet_field* o) : TArray_sheet(x, y, dx, dy, maskname, head, 0, parent), _owner(o), - _mask(maskname, NO_MODE, maskno), _notify(NULL) + _mask(maskname, maskno), _notify(NULL) {} bool TSpreadsheet::on_key(KEY k) @@ -904,32 +929,6 @@ void TSpreadsheet::enable_cell(int row, int column, bool on) } -void TSpreadsheet::enable(bool on) -{ - const dword old = xi_get_attrib(_list); - dword att = on ? (old & ~XI_ATR_NAVIGATE) : (old | XI_ATR_NAVIGATE); - if (old != att) - { - int num; - XI_OBJ** columns = xi_get_member_list(_list, &num); - - xi_move_focus(_itf); // Set focus to interface - - att = on ? (att | XI_ATR_TABWRAP) : (att & ~XI_ATR_TABWRAP); - xi_set_attrib(_list, att); - - for (int col = 1; col < num; col++) - { - XI_OBJ* column = columns[col]; - dword attr = xi_get_attrib(column); - if (on) attr &= ~XI_ATR_READONLY; - else attr |= XI_ATR_READONLY; - xi_set_attrib(column, attr); // Set new attributes - } - } -} - - void TSpreadsheet::enable_column(int col, bool on) { const bool change = _column_disabled[col] == on;