mask.h Corretto commento incomprensibile di autoquack
msksheet.cpp Virtualizzata sheet_mask() git-svn-id: svn://10.65.10.50/trunk@1929 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7e4f0952c9
commit
3c555208e4
@ -325,7 +325,7 @@ public:
|
|||||||
// @cmember Ritorna il primo campo dirty
|
// @cmember Ritorna il primo campo dirty
|
||||||
short dirty() const;
|
short dirty() const;
|
||||||
|
|
||||||
// @cmember Setta lo sheet che gestisce la maschera
|
// @cmember Setta lo sheet di cui la maschera gestisce le righe
|
||||||
void set_sheet(TSheet_field* s)
|
void set_sheet(TSheet_field* s)
|
||||||
{ _sheet = s; }
|
{ _sheet = s; }
|
||||||
|
|
||||||
|
@ -174,8 +174,8 @@ public:
|
|||||||
bool cell_disabled(int row, int column) const;
|
bool cell_disabled(int row, int column) const;
|
||||||
|
|
||||||
// @cmember Ritorna la maschera che appartiene allo spreadsheet
|
// @cmember Ritorna la maschera che appartiene allo spreadsheet
|
||||||
TMask& sheet_mask()
|
TMask& sheet_mask() const;
|
||||||
{ return _mask; }
|
|
||||||
// @cmember Ritorna la maschera cui appartiene lo spreadsheet
|
// @cmember Ritorna la maschera cui appartiene lo spreadsheet
|
||||||
TMask& mask() const;
|
TMask& mask() const;
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
_mask.set_sheet(o);
|
sheet_mask().set_sheet(o);
|
||||||
|
|
||||||
// Calcolo larghezza massima tabella
|
// Calcolo larghezza massima tabella
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
listdef->v.list->white_space_color = MASK_DARK_COLOR;
|
listdef->v.list->white_space_color = MASK_DARK_COLOR;
|
||||||
|
|
||||||
word attr = XI_ATR_RJUST;
|
word attr = XI_ATR_RJUST;
|
||||||
if (_mask.id2pos(FIRST_FIELD -1) != -1)
|
if (sheet_mask().id2pos(FIRST_FIELD -1) != -1)
|
||||||
attr |= XI_ATR_SELECTABLE;
|
attr |= XI_ATR_SELECTABLE;
|
||||||
|
|
||||||
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0, NUMBER_WIDTH, NUMBER_WIDTH,
|
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0, NUMBER_WIDTH, NUMBER_WIDTH,
|
||||||
@ -430,9 +430,18 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
|
|
||||||
TSpreadsheet::~TSpreadsheet()
|
TSpreadsheet::~TSpreadsheet()
|
||||||
{
|
{
|
||||||
|
if (_getmask != NULL)
|
||||||
|
_getmask(0, _mask, TRUE); // Distrugge la maschera customizzata
|
||||||
|
|
||||||
set_win(NULL_WIN);
|
set_win(NULL_WIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TMask& TSpreadsheet::sheet_mask() const
|
||||||
|
{
|
||||||
|
TMask& m = ((TSpreadsheet*)this)->_mask;
|
||||||
|
return (_getmask != NULL) ? *_getmask((int)_cur_rec, m, FALSE ) : m;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Converts a row number in the correspondig record number
|
// Converts a row number in the correspondig record number
|
||||||
int TSpreadsheet::row2rec(int& row)
|
int TSpreadsheet::row2rec(int& row)
|
||||||
@ -629,8 +638,6 @@ bool TSpreadsheet::destroy(
|
|||||||
if (ok && mask().is_running())
|
if (ok && mask().is_running())
|
||||||
update(-1);
|
update(-1);
|
||||||
|
|
||||||
// Notifica l'avvenuta cancellazione
|
|
||||||
notify( rec, K_CTRL + K_DEL );
|
|
||||||
indestroy = FALSE;
|
indestroy = FALSE;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -808,13 +815,13 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
|||||||
update(_cur_rec); // Forces update delayed by str2mask
|
update(_cur_rec); // Forces update delayed by str2mask
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_mask.id2pos(FIRST_FIELD-1) != -1)
|
if (sheet_mask().id2pos(FIRST_FIELD-1) != -1)
|
||||||
{
|
{
|
||||||
TMask_field& button = _mask.field(FIRST_FIELD-1);
|
TMask_field& button = sheet_mask().field(FIRST_FIELD-1);
|
||||||
if (button.active())
|
if (button.active())
|
||||||
{
|
{
|
||||||
button.on_hit();
|
button.on_hit();
|
||||||
if (_mask.dirty())
|
if (sheet_mask().dirty())
|
||||||
{
|
{
|
||||||
notify_change();
|
notify_change();
|
||||||
mask2str(_cur_rec);
|
mask2str(_cur_rec);
|
||||||
@ -1010,7 +1017,7 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
|||||||
const bool ok = _edit_field->on_key(k);
|
const bool ok = _edit_field->on_key(k);
|
||||||
if (!ok && k == K_F9) // Ricerca non completata?
|
if (!ok && k == K_F9) // Ricerca non completata?
|
||||||
{
|
{
|
||||||
_edit_field = &_mask.fld(_mask.focus_field());
|
_edit_field = &sheet_mask().fld(sheet_mask().focus_field());
|
||||||
const short foca = _edit_field->dlg();
|
const short foca = _edit_field->dlg();
|
||||||
const int col = (foca - FIRST_FIELD) % 100 +1;
|
const int col = (foca - FIRST_FIELD) % 100 +1;
|
||||||
if (col > 0 && col != _cur_col) // Ricerca alternativa
|
if (col > 0 && col != _cur_col) // Ricerca alternativa
|
||||||
@ -1176,7 +1183,7 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
|||||||
: TArray_sheet(x, y, dx, dy, maskname, head, 0, parent), _owner(o),
|
: TArray_sheet(x, y, dx, dy, maskname, head, 0, parent), _owner(o),
|
||||||
_mask(maskname, maskno), _notify(NULL), /* Matteo */ _getmask( NULL )
|
_mask(maskname, maskno), _notify(NULL), /* Matteo */ _getmask( NULL )
|
||||||
{
|
{
|
||||||
_mask.set_sheet(o);
|
sheet_mask().set_sheet(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TSpreadsheet::on_key(KEY k)
|
bool TSpreadsheet::on_key(KEY k)
|
||||||
@ -1247,8 +1254,8 @@ TMask& TSpreadsheet::mask() const
|
|||||||
// Ritorna il campo con l'identificatore dato della maschera dello sheet
|
// Ritorna il campo con l'identificatore dato della maschera dello sheet
|
||||||
TMask_field* TSpreadsheet::field(short id) const
|
TMask_field* TSpreadsheet::field(short id) const
|
||||||
{
|
{
|
||||||
const int pos = _mask.id2pos(id);
|
const int pos = sheet_mask().id2pos(id);
|
||||||
return pos < 0 ? NULL : &_mask.fld(pos);
|
return pos < 0 ? NULL : &sheet_mask().fld(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1612,7 +1619,8 @@ KEY TSpreadsheet::edit(int n, KEY tasto)
|
|||||||
destroy(n);
|
destroy(n);
|
||||||
if (n < items())
|
if (n < items())
|
||||||
str2mask(n);
|
str2mask(n);
|
||||||
}
|
notify(n, K_CTRL+K_DEL); // Notifica l'avvenuta cancellazione
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (k == K_ESC)
|
if (k == K_ESC)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user