date.cpp Allineati giorni della settimana in itow

msksheet.cpp Corretta disabilitazione campi nel dettaglio di uno sheet read-only


git-svn-id: svn://10.65.10.50/trunk@2567 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-02-06 12:12:32 +00:00
parent c02f955b18
commit 12b0841f1a
2 changed files with 9 additions and 24 deletions

View File

@ -643,8 +643,7 @@ const char* itow(
// giorno corrispondente a tale cifra (es. 15 = "Lunedi") // giorno corrispondente a tale cifra (es. 15 = "Lunedi")
{ {
const char* nomi[7] = const char* nomi[7] =
{ "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", { "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato", "Domenica" };
"Sabato", "Domenica" };
return nomi[(d-1) % 7]; return nomi[(d-1) % 7];
} }

View File

@ -1496,11 +1496,14 @@ void TSpreadsheet::mask2str(int rec)
{ {
r.add(f.get()); r.add(f.get());
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
const int col = id-FIRST_FIELD; if (active())
if (!_column_disabled[col])
{ {
const bool on = f.enabled(); const int col = id-FIRST_FIELD;
enable_cell(rec, col, on); if (!_column_disabled[col])
{
const bool on = f.enabled();
enable_cell(rec, col, on);
}
} }
#endif #endif
break; break;
@ -1741,7 +1744,7 @@ void TSpreadsheet::str2mask(int riga)
const int index = (id % 100)-1; const int index = (id % 100)-1;
val = r.get(index); val = r.get(index);
f.set(val); f.set(val);
const bool on = !cell_disabled(riga, index); const bool on = active() && !cell_disabled(riga, index);
if (f.enabled() != on) if (f.enabled() != on)
f.enable(on); f.enable(on);
} }
@ -1786,17 +1789,6 @@ bool TSpreadsheet::notify(int rec, KEY k)
return ok; return ok;
} }
HIDDEN void enable_mask_fields(TMask& m, bool on)
{
for (int i = m.fields()-1; i >= 0; i--)
{
TMask_field& f = m.fld(i);
if (f.dlg() >= FIRST_FIELD && f.enabled_default())
f.enable(on);
}
}
// Certified 99% // Certified 99%
#if XVT_OS != XVT_OS_WIN #if XVT_OS != XVT_OS_WIN
KEY TSpreadsheet::edit(int n, KEY tasto) KEY TSpreadsheet::edit(int n, KEY tasto)
@ -1840,13 +1832,7 @@ KEY TSpreadsheet::edit(int n, KEY tasto)
} }
else else
{ {
if (!active()) // Se lo sheet e' read only ...
enable_mask_fields(sheet_mask(), FALSE); // ... disabilita tutti i campi
k = sheet_mask().run(); // Esegue la maschera dello sheet k = sheet_mask().run(); // Esegue la maschera dello sheet
if (!active()) // Se lo sheet e' read only ...
enable_mask_fields(sheet_mask(), TRUE); // ... riabilita tutti i campi
} }
if (active) if (active)