From a3c722b54f7088ec87e58bbfd800a0f41b7bb5a4 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 24 Aug 2010 23:02:43 +0000 Subject: [PATCH] Patch level : 10,0 nopatch Files correlati : ci0.exe ci2.exe Ricompilazione Demo : [ ] Commento : Rilevazione ore git-svn-id: svn://10.65.10.50/branches/R_10_00@20795 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ca/calib01.cpp | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/ca/calib01.cpp b/ca/calib01.cpp index 8df3371dd..516f59aaf 100755 --- a/ca/calib01.cpp +++ b/ca/calib01.cpp @@ -676,19 +676,25 @@ int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y, par_items = ca_multilevel_code_info(LF_COMMESSE).levels(); } - int maxkeylen = 0, maxdeslen = 0; + const int items = par_items > 0 ? par_items : mci.levels(); + int maxkeylen = 0, maxdeslen = 0; + for (int level = 0; level < mci.levels(); level++) { - const TString& prompt = mci.prompt(level); const TString& picture = mci.picture(level); const int keylen = picture.len(); - const int deslen = (level == 0 || level == par_items) ? prompt.len() : 0 ; + int deslen = 0; + + if ((level == 0 && items == 1) || (level == par_items && mci.levels() - par_items == 1)) + deslen = mci.prompt(level).len(); + else + deslen = logicnum != LF_FASI || mci.parent() > 0 ? 8 : 4 ; + if (deslen > maxdeslen) maxdeslen = deslen; if (keylen > maxkeylen) maxkeylen = keylen; - if (deslen > maxdeslen) maxdeslen = deslen; } maxdeslen++; - const int tab0 = x; + const int tab0 = x; int offset = 0; int desc_offset = 0; int row_offset = 0; @@ -700,7 +706,35 @@ int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y, const short kid = key_id+i; const TString& picture = mci.picture(i); - TString80 prompt = (i == 0 || i == par_items) ? mci.prompt(i) : ""; + TString80 prompt; + + if (i == 0) + { + int ln = logicnum; + if (ln == LF_FASI && mci.parent() > 0) + ln = mci.parent(); + switch (ln) + { + case LF_PCONANA : + prompt = items == 1 ? mci.prompt(i) : "Conto"; + break; + case LF_COMMESSE : + prompt = items == 1 ? mci.prompt(i) : "Commessa"; + break; + case LF_CDC : + prompt = items == 1 ? mci.prompt(i) : "C. Costo"; + break; + case LF_FASI : + prompt = items == 1 ? mci.prompt(i) : "Fase"; + break; + default: + break; + } + } + else + if (i == par_items) + prompt = mci.levels() - par_items == 1 ? mci.prompt(i) : "Fase" ; + if (prompt.full()) prompt.left_just(maxdeslen);