Patch level : 10.0 916

Files correlati     : ci2.exe
Ricompilazione Demo : [ ]
Commento            :

Nella rilevazione ore preventiva e consuntiva  se imposto un campo nella testata la collona corrispondente viene nascosta e disabilitata


git-svn-id: svn://10.65.10.50/branches/R_10_00@21607 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2011-02-09 00:21:23 +00:00
parent f4e02b3f68
commit c050a7d07a
2 changed files with 50 additions and 16 deletions

View File

@ -39,6 +39,7 @@ protected:
void get_row_anal_fields(TToken_string & row, TString & cdc, TString & cms, TString & fase);
void put_row_anal_fields(TToken_string & row, const TString & cdc, const TString & cms, const TString & fase);
void carica_default();
void update_column(short sid, bool full);
void riempi_sheet();
void nuova_riga();
void azzera_riga(TSheet_field& sheet);
@ -346,11 +347,22 @@ void TRilevamento_prev_msk::carica_default()
sheet.force_update();
}
void TRilevamento_prev_msk::update_column(short sid, bool full)
{
TSheet_field& sf = sfield(F_SHEET);
sf.enable_column(sid, !full);
if (full)
sf.set_column_width(sid, 0);
}
//RIEMPI_SHEET: metodo che riempie lo sheet in base ai campi chiave
//compilati sulla maschera
void TRilevamento_prev_msk::riempi_sheet()
{
TSheet_field& sheet = sfield(F_SHEET);
TMask & sm = sheet.sheet_mask();
if (sheet.items() > 0 && sheet.dirty() && yesno_box("Vuoi salvare le modifiche"))
registra();
@ -379,6 +391,34 @@ void TRilevamento_prev_msk::riempi_sheet()
get_anal_fields(codcosto, codcms, codfase);
sheet.set_columns_order();
update_column(S_DADATA, da.ok());
update_column(S_ADATA, a.ok());
update_column(S_RISOATT, risoatt.full());
update_column(S_CODRIS, codice.full());
update_column(S_DESRIS, codice.full());
update_column(S_CODATT, codice.full());
update_column(S_DESATT, codice.full());
update_column(S_TPORA, tpora.full());
if (_scdc_sid >= 0)
for ( short id = _scdc_sid; id <= _scdc_lid; id++)
{
update_column(id - 100, codcosto.full());
sm.enable(id + 50, codcosto.blank());
}
if (_scms_sid >= 0)
for ( short id = _scms_sid; id <= _scms_lid; id++)
{
update_column(id - 100, codcms.full());
sm.enable(id + 50, codcms.blank());
}
if (_sfase_sid >= 0)
for ( short id = _sfase_sid; id <= _sfase_lid; id++)
{
update_column(id - 100, codfase.full());
sm.enable(id + 50, codfase.blank());
}
TString query;
query << "USE " << LF_RILORE << " KEY 2\n" ;
@ -902,6 +942,7 @@ TRilevamento_prev_msk::TRilevamento_prev_msk()
s.set_column_header(id, prompt);
s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD));
s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX);
s.update_column_width(id);
s.enable_column(id);
set_insheet_universal_handler(F_SHEET, id);
set_insheet_universal_handler(F_SHEET, id + 50);

View File

@ -56,7 +56,7 @@ protected:
void update_prev();
void riempi_sheet();
void riempi_calendario(const TString & query);
void update_column(short sid, const bool full, int len = -1);
void update_column(short sid, const bool full);
void riempi_risoatt(char tipo = 'C');
void nuova_riga();
void azzera_riga(TSheet_field& sheet);
@ -371,28 +371,19 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
calendario.force_update();
}
void TRilevamento_cons_msk::update_column(short sid, bool full, int len)
void TRilevamento_cons_msk::update_column(short sid, bool full)
{
TSheet_field& sf = sfield(F_SHEET);
TMask_field& f = sf.sheet_mask().field(sid);
if (len < 0)
{
const TString prompt = f.prompt();
len = prompt.len();
}
const int column = sf.cid2index(sid);
sf.enable_column(column, !full);
sf.set_column_width(column, !full ? (max(3 + f.size(), len + 1) * CHARX) : 0);
if (full)
sf.set_column_width(sid, 0);
// sf.set_column_width(column, !full ? (max(3 + f.size(), len + 1) * CHARX) : 0);
}
void TRilevamento_cons_msk::riempi_risoatt(char tipo)
{
TSheet_field& sheet = sfield(F_SHEET);
TMask & sm = sheet.sheet_mask();
if (sheet.items() > 0 && sheet.dirty() && yesno_box("Vuoi salvare le modifiche"))
registra();
sheet.destroy();
@ -416,12 +407,13 @@ void TRilevamento_cons_msk::riempi_risoatt(char tipo)
}
update_disp();
get_anal_fields(codcosto, codcms, codfase);
sheet.set_columns_order();
update_column(S_RISOATT, risoatt.full());
update_column(S_CODRIS, codice.full());
update_column(S_DESRIS, codice.full());
update_column(S_CODATT, codice.full());
update_column(S_DESATT, codice.full());
update_column(S_TPORA, tpora.full(), 4);
update_column(S_TPORA, tpora.full());
if (_scdc_sid >= 0)
for ( short id = _scdc_sid; id <= _scdc_lid; id++)
{
@ -1252,6 +1244,7 @@ TRilevamento_cons_msk::TRilevamento_cons_msk()
s.set_column_header(id, prompt);
s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD));
s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX);
s.update_column_width(id);
s.enable_column(id);
set_insheet_universal_handler(F_SHEET, id);
set_insheet_universal_handler(F_SHEET, id + 50);