Aggiunto distruttore
git-svn-id: svn://10.65.10.50/trunk@700 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f155f29c49
commit
f2d3d19d5b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user