From f029de345030376d8fe29251caf67b91efd630c5 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 30 Jul 2002 14:11:47 +0000 Subject: [PATCH] Patch level : AGA 02.00 314 Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione Partners 2.0 patch 314 git-svn-id: svn://10.65.10.50/trunk@10444 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba0.cpp | 12 ++-- ba/ba1.cpp | 6 +- ba/ba1100.cpp | 6 +- ba/ba1400.cpp | 2 +- ba/ba1700.cpp | 2 +- ba/ba1800.cpp | 2 +- ba/bainst.cpp | 154 ++++++++++++++++++++--------------------------- ba/bainst11.cpp | 6 +- ba/bainst17.cpp | 24 ++++---- cg/cg2100.cpp | 9 --- cg/cg2102.h | 7 --- cg/cg2106.cpp | 123 ------------------------------------- cg/cg4200.cpp | 11 ++-- cg/cg4300.cpp | 7 +-- cg/cg4400.cpp | 3 +- cg/cg4800.cpp | 6 +- cg/cg4900.cpp | 3 +- cg/cg5500.cpp | 3 - cg/cg5600.cpp | 3 +- cg/cgmenu.men | 4 +- db/dblib.cpp | 54 ++++++++--------- db/dblib.h | 2 +- ve/ve1100.cpp | 3 +- ve/vearea.men | 2 + ve/velib03.cpp | 8 ++- ve/velib03a.cpp | 2 +- xi/xi2.c | 9 ++- xvaga/agasys.cpp | 26 +++++--- xvaga/xvaga.cpp | 36 ++++++++--- 29 files changed, 200 insertions(+), 335 deletions(-) diff --git a/ba/ba0.cpp b/ba/ba0.cpp index 7310b2598..b6f62952f 100755 --- a/ba/ba0.cpp +++ b/ba/ba0.cpp @@ -2566,16 +2566,16 @@ int main(int argc, char** argv) { TApplication::check_parameters(argc, argv); - if (user().blank()) - { - char name[16]; - if (aga_get_user_name(name, 16)) - user() = name; - } if (user().blank()) { TConfig prawin(CONFIG_INSTALL, "Main"); user() = prawin.get("User"); + if (user().blank() || user() == dongle().administrator()) + { + char name[32]; + if (aga_get_user_name(name, 32)) + user() = name; + } } TFilename menu = (argc < 2) ? MEN_FILE : argv[1]; diff --git a/ba/ba1.cpp b/ba/ba1.cpp index b6adcbdcf..be93e0afc 100755 --- a/ba/ba1.cpp +++ b/ba/ba1.cpp @@ -17,11 +17,11 @@ int main(int argc,char** argv) case 3: ba1400(argc,argv); break; // Set users case 4: - ba1500(argc,argv); break; + ba1500(argc,argv); break; // Activate modules case 5: - ba1600(argc,argv); break; + ba1600(argc,argv); break; // Disks generation case 6: - ba1700(argc,argv); break; + ba1700(argc,argv); break; // Install modules case 7: ba1800(argc,argv); break; case 8: diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index d7e177ddc..b263e0fe9 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -914,7 +914,7 @@ void TManutenzione_app::update_dir() if (flags < 10000L && size > 0L && d.len() > 0) { TSystemisamfile b(i); - int err = b.is_valid(); + int err = b.is_valid(TRUE); if (err == _istrcerr && d.eod() == 0 && yesno_box("Il tracciato record del file %d e' incoerente:\n" "Si desidera eliminare il file vuoto %s?", i, d.filename())) @@ -1131,7 +1131,7 @@ void TManutenzione_app::convert_dir() else s << "della ditta " << atol (pref) << "."; s << " Memoria libera: " << long(os_get_free_memory()/1024) << " Kbytes."; - TProgind p(update_items ? update_items : 1, s, FALSE, TRUE, 70); + TProgind p(update_items ? update_items : 1, s, FALSE, TRUE); p.setstatus(1); for (int i = 2; i <= update_items; i++) @@ -1148,7 +1148,7 @@ void TManutenzione_app::convert_dir() { TSystemisamfile b(i); const int module = abs((int)ds.flags()); - int err = b.is_valid(); + int err = b.is_valid(TRUE); if (err == -60 || err == -64) err=NOERR; // verif. d.get(i, _nolock, _nordir, _sysdirop); if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm()))) diff --git a/ba/ba1400.cpp b/ba/ba1400.cpp index 8ef7d2248..b786428a7 100755 --- a/ba/ba1400.cpp +++ b/ba/ba1400.cpp @@ -633,7 +633,7 @@ bool TSet_users::user_create() sf.set_notify(k_notify); #ifdef XVAGA - const char* menuname = "bacampo.men"; + const char* menuname = "bamenu.men"; #else const char* menuname = "baprassi.men"; #endif diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 6b1fe9687..16c6351cc 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -1166,7 +1166,7 @@ bool TInstaller_mask::on_key(KEY key) TInstaller_mask::TInstaller_mask() : TArray_sheet(0, 0, 0, 0, "Installazione", - "@1|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento", + "@1C|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento", 0x18, 3) { _curr_mask = this; diff --git a/ba/ba1800.cpp b/ba/ba1800.cpp index 2ec97e81d..98d0afa63 100755 --- a/ba/ba1800.cpp +++ b/ba/ba1800.cpp @@ -35,7 +35,7 @@ HIDDEN int str2isamfile(const TString& str) if (logic < get_isamfiles()) { TBaseisamfile file(logic); - if (file.is_valid() == NOERR) + if (file.is_valid(FALSE) == NOERR) logic_num = logic; } } diff --git a/ba/bainst.cpp b/ba/bainst.cpp index 40c70532f..0aade0687 100755 --- a/ba/bainst.cpp +++ b/ba/bainst.cpp @@ -2,7 +2,6 @@ #include #include #include -#include // prototipi #include "bainsta.h" #include "bainst.h" @@ -39,8 +38,6 @@ int TSystemtempfile::load( if (fl == NULL) { error_box("Non riesco ad aprire il file %s",from); - clearerr(fl); - setstatus(2); return 2; } TRecnotype r = 0, e = 0, nitems = 0, nread = 0; @@ -58,10 +55,24 @@ int TSystemtempfile::load( if (ditte.read() == NOERR) attprev = ditte.get("CODATTPREV"); } + if (fl == NULL) + { + clearerr(fl); + setstatus(err); + return err; + } + char w[80]; + while ((fgets(w, 80, fl) != NULL)) + { + if (strncmp(w, "[Data]", 6) == 0) + { + nitems = ftell(fl); + break; + } + } fseek(fl, 0L, SEEK_END); - nitems = ftell(fl); + nitems = ftell(fl) - nitems; fclose(fl); - TScanner f(from); //open(); @@ -69,7 +80,7 @@ int TSystemtempfile::load( TToken_string s(1024, fs); bool fixedlen = (fs == '\0'); int nflds = curr().items(); - TString_array fld(nflds); + TArray fld(nflds); int len[MaxFields]; TString sfd(3); TString s1(64); @@ -77,54 +88,50 @@ int TSystemtempfile::load( if (f.paragraph("Header")) { - int equal; - TString key; + f.equal(); + const long level = atol(f.line()); +//rimosso il controllo sul livello archivi;tanto la conversione la fa lo stesso +// if (level > get_std_level()) +// error_box("L'archivio %s e' stato generato con gli archivi di livello %ld%/%ld.\n Il livello attuale e' %ld/%ld.\n Convertire gli archivi e ripetere l' operazione.", +// from, level/100, level%100, get_std_level()/100, get_std_level()%100); + nflds = 0; - while ((equal = f.line().find('=')) > 0) + TToken_string s2(f.line()); + int p = s2.find('='); + if (p > 0) { - key = f.token().left(equal); - key.trim(); - if (key == "Version") + s1 = s2.left(p); + s2.ltrim(p+1); + } + else s1.cut(0); + while (s1 == "Fields") + { + for (const char * fd = s2.get(); fd != NULL; fd = s2.get()) { - const long level = atol(f.token().mid(equal+1)); - if (level > prefix().filelevel()) - error_box("L'archivio %s e' stato generato con gli archivi di livello %ld%/%ld.\n Il livello attuale e' %ld/%ld.\n Convertire gli archivi e ripetere l' operazione.", - from, level/100, level%100, get_std_level()/100, get_std_level()%100); -// lcf = getlcf(level); - } else - if (key == "File") + TToken_string wfd(fd, ','); + fld.add(new TString(wfd.get())); + len[nflds] = wfd.get_int(); + nflds++; + } + s2 = f.line(); + p = s2.find('='); + if (p > 0) { - const int logic = atoi(f.token().mid(equal+1)); - if (logic != num()) - error_box("L'archivio %s e' stato generato dal file %d", - from, logic); - } else - if (key == "Fields") - { - TToken_string riga = f.token().mid(equal+1); - TToken_string wfd(32, ','); - FOR_EACH_TOKEN(riga, fd) - { - wfd = fd; wfd.strip_spaces(); - fld.add(wfd.get(0)); - len[nflds] = wfd.get_int(); - nflds++; - } - } + s1 = s2.left(p); + s2.ltrim(p+1); + } + else s1.cut(0); } } - - if (nflds == 0 || fld.items() == 0) - { - nflds = curr().items(); + else + { for (int j = 0; j < nflds; j++) { - fld.add(curr().fieldname(j), j); + fld.add(TString(curr().fieldname(j)), j); const TString & wfld = (const TString & ) fld[j]; len[j] = (curr().type(wfld) == _datefld) ? 10 : curr().length(wfld); } } - if (!f.paragraph("Data")) { error_box("Formato dei dati non valido"); @@ -155,7 +162,7 @@ int TSystemtempfile::load( } if ((r + e) % 50 == 0) { - s1.format("Imp. archivio %d\n%6ld records %6ld errori - %3d", _logicnum, r, e, last); + s1.format("Imp. archivio %s\n%6ld records %6ld errori - %3d", filename(), r, e, last); p.set_text(s1); } p.setstatus(nread + 1); @@ -183,29 +190,21 @@ int TSystemtempfile::load( s2++; s2[strlen(s2) - 1] = '\0'; } - if (curr().type((const TString&) fld[j]) == _memofld) - s1 = esc(s2); - else - s1 = s2; put((const TString&) fld[j], s2); } } - int err = write(); - if (err == _isreinsert) - err = rewrite(); - - if (err == NOERR) - r++; + if (write() == NOERR) r++; else { - error_box("Errore di scrittura alla riga %ld", r+e+1); +#ifdef DBG + yesnofatal_box("Numero linea relativa all'errore: %ld",r+e+1); +#endif e++; last = status(); - break; } s = f.line(); } - s1.format("Imp. archivio %d\n%6ld records %6ld errori - %3d", _logicnum, r, e, last); + s1.format("Imp. archivio %s\n%6ld records %6ld errori - %3d", filename(), r, e, last); p.set_text(s1); //close(); setstatus(err); @@ -259,15 +258,12 @@ int TSystemtempfile::dump( len[j] = (t == _datefld) ? 10 : curr().length(wfld); } TRecnotype i = 0; - const TRecnotype nitems = items(); - - s.format("Esportazione archivio %s", filename()); + s.format("Esportazione archivio %s", filename()); TProgind p(nitems, s, TRUE, TRUE, 70); - TString s1,sfld; + TString s1; - fprintf(f, "[Header]\nVersion=%ld\nFile=%d", - prefix().filelevel(), num()); + fprintf(f, "[Header]\nVersion=%ld", prefix().filelevel()); for (int k = 0; k < nflds; k++) { if ((k % 10) == 0) fprintf(f, "\nFields="); @@ -295,17 +291,7 @@ int TSystemtempfile::dump( s1 = ""; if (j && fs) s1 << fs; if (fd) s1 << fd; - sfld = get((const TString&)fld[j]); - if (curr().type((const TString&) fld[j]) == _memofld) - { - int p = 0; - while ((p = sfld.find('\n', 0)) >= 0) - { - sfld.overwrite("\\", p); - sfld.insert("n", p+1); - } - } - s1 << sfld; + s1 << get((const TString&)fld[j]); if (fd) s1 << fd; } s << s1; @@ -336,18 +322,8 @@ int TSystemtempfile::dump( s1 = ""; if (j && fs) s1 << fs; if (fd) s1 << fd; - s1 = get((const TString&)fld[j]); - if (curr().type((const TString&) fld[j]) == _memofld) - { - int p = 0; - while ((p = sfld.find('\n', 0)) >= 0) - { - sfld.overwrite("\\", p); - sfld.insert("n", p+1); - } - } - s1 << sfld; - if (fd) s1 << fd; + s1 << get((const TString&)fld[j]); + if (fd) s1 << fd; } s << s1; } @@ -393,7 +369,7 @@ bool TStd_filename::check(bool verbose,const char * n) bool TInstallmodule_app::create() { - TScanner scanner(AUT_FILE); + TScanner scanner("campo.aut"); bool ok = FALSE; for (int aut = 0; aut<=module_number(); aut++) @@ -568,11 +544,11 @@ int main(int argc,char** argv) else if (mod == "mg") r=bainst32(argc, argv);// pre/post installazione magazzino: else if (mod == "ef") - r=bainst34(argc, argv);// pre/post installazione effetti: - else if (mod == "sv") - r=bainst38(argc, argv);// pre/post installazione statistiche: + r=bainst34(argc, argv);// pre/post installazione effetti: else if (mod == "db") r=bainst35(argc, argv);// pre/post installazione distinta base: + else if (mod == "sv") + r=bainst38(argc, argv);// pre/post installazione statistiche: else if (mod == "mr") r=bainst39(argc, argv);// pre/post installazione MRP else diff --git a/ba/bainst11.cpp b/ba/bainst11.cpp index 246f7d12f..8b2599c8d 100755 --- a/ba/bainst11.cpp +++ b/ba/bainst11.cpp @@ -18,7 +18,7 @@ public: virtual ~TInstall_CE () {} }; -bool TInstall_CE ::install_com(bool in_lire) +bool TInstall_CE::install_com(bool in_lire) { const char* tab[5] = {"cac","cat","cgr","tmc","clm"}; if (in_lire) @@ -30,8 +30,8 @@ bool TInstall_CE ::install_com(bool in_lire) for (int i=0; i<5; i++) { str = tab[i]; str << ".txt"; - txtfile.check(FALSE, str); - tabcom.load(txtfile); + if (txtfile.check(TRUE, str)) + tabcom.load(txtfile); } return TRUE; } diff --git a/ba/bainst17.cpp b/ba/bainst17.cpp index ad686c64d..294a3d82e 100755 --- a/ba/bainst17.cpp +++ b/ba/bainst17.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "bainst.h" #include "bainst17.h" @@ -8,33 +9,30 @@ class TInstall_AT : public TInstallmodule_app { protected: + virtual bool load_default_data() const ; virtual int module_number() const {return 17;} virtual bool preload_mask() ; - virtual bool install_firm() ; // bool post_installer() ; public: virtual ~TInstall_AT () {} }; -bool TInstall_AT ::install_firm() -{ - bool ok=TRUE; - set_firm(1); // provvisorio .... - TStd_filename txtfile("svtab.txt"); - if (txtfile.check(TRUE)) - { - TSystemisamfile tabditta(LF_TAB); - tabditta.load(txtfile); - } - return ok; +bool TInstall_AT ::load_default_data() const +{ + if (prefix().get_codditta() <= 0) + return TRUE; + TTable ido("IDO"); + const bool empty = ido.first() != NOERR; + + return empty; } bool TInstall_AT ::post_installer() { #ifdef XVAGA - const char* menuname = "bacampo.men"; + const char* menuname = "bamenu.men"; #else const char* menuname = "baprassi.men"; #endif diff --git a/cg/cg2100.cpp b/cg/cg2100.cpp index 701a3c2c9..c54655144 100755 --- a/cg/cg2100.cpp +++ b/cg/cg2100.cpp @@ -152,12 +152,6 @@ TMask* TPrimanota_application::load_mask(int n) m->set_handler(SK_CAMBIO, cambio_handler); m->set_handler(SK_TOTDOCVAL, totdocval_handler); - if (easydoc_installed()) - { - m->show(F_EASYDOC); - m->set_handler(F_EASYDOC, easydoc_handler); - } - TSheet_field& cg = (TSheet_field&)m->field(F_SHEETCG); cg.set_notify(cg_notify); TMask& cgm = cg.sheet_mask(); @@ -1197,9 +1191,6 @@ bool TPrimanota_application::remove() } link_cesp(m, "Remove"); link_intra(m, "Remove"); - - if (easydoc_connected()) - run_easydoc("Elimina"); } return ok; } diff --git a/cg/cg2102.h b/cg/cg2102.h index 643a180af..c85ab7f51 100755 --- a/cg/cg2102.h +++ b/cg/cg2102.h @@ -90,8 +90,6 @@ class TPrimanota_application : public TRelation_application TAssoc_array _colori; // Colori delle righe - TFilename _EasyDocPath; // Path eseguibile EasyDoc - static bool showpartite_handler(TMask_field& f, KEY k); static bool speserimb_handler(TMask_field& f, KEY k); static bool altrespese_handler(TMask_field& f, KEY k); @@ -157,7 +155,6 @@ class TPrimanota_application : public TRelation_application static bool pag_notify(TSheet_field& s, int r, KEY key); static bool pag_sheet_handler(TMask_field& f, KEY key); - static bool easydoc_handler(TMask_field& f, KEY k); void reset_sheet_row(TSheet_field& s, int n); int crea_somma_spese(TImporto& imp); @@ -309,10 +306,6 @@ public: TString_array& pag_rows() { return _pag_rows; } TImporto get_cgs_imp(int n); - bool easydoc_installed(); - bool easydoc_connected(); - bool run_easydoc(const char* azione) const; - TPrimanota_application(); virtual ~TPrimanota_application() { } }; diff --git a/cg/cg2106.cpp b/cg/cg2106.cpp index 15fbbbc89..b9d16e8d9 100755 --- a/cg/cg2106.cpp +++ b/cg/cg2106.cpp @@ -393,126 +393,3 @@ bool TPrimanota_application::prorata_handler(TMask_field& f, KEY k) return TRUE; } -/////////////////////////////////////////////////////////// -// Gestione EasyDoc -/////////////////////////////////////////////////////////// - -bool TPrimanota_application::easydoc_installed() -{ - // check autorization - if (!has_module(AIAUT)) - { - _EasyDocPath = " "; - return FALSE; - return os_get_image_editor_path(_EasyDocPath); -} - -// Il documento attuale e' connesso a easydoc? -bool TPrimanota_application::easydoc_connected() -{ - return !_EasyDocPath.blank(); -} - -bool TPrimanota_application::run_easydoc(const char* azione) const -{ - const TMask& m = curr_mask(); - - TString cmdline = _EasyDocPath; - TFilename ininame; - - if (azione && *azione) - { - // linea comando EasyDoc - ininame.tempdir(); - ininame.add("easydoc.ini"); - cmdline << ' ' << ininame; - - // path dei dati della ditta - TFilename dati_dir = get_firm_dir(); - // completa path relativo, - // ma che male c'era a registrarlo sempre assoluto?? - if (dati_dir.is_relative_path()) - { - TFilename modulename(argv(0)); - modulename = modulename.path(); - modulename.add(dati_dir); - dati_dir = modulename; - } - - // rimuove barre e controbarre per dargli un aspetto decente - dati_dir.replace('/','\\'); - for (int pos = dati_dir.find("\\\\"); pos >= 0; pos = dati_dir.find("\\\\")) - dati_dir[pos] = ' '; - dati_dir.strip_spaces(); - - // nome archivio - TFilename archivio(dati_dir); - archivio.add("easydoc.mdb"); - - // drive di archiviazione - TString drv_di_arch; - if (dati_dir[1] == ':') - drv_di_arch = dati_dir.left(2); - - // directory di archiviazione - TString dir_di_arch(dati_dir); - if (dir_di_arch[1] == ':') - dir_di_arch.ltrim(2); - dir_di_arch << SLASH; - - // prepara sempre sezione "EASYDOC" - TConfig ini(ininame, "EASYDOC"); - ini.set("Azione", azione); - ini.set("Archivio", archivio); - ini.set("Cartella", "Movimenti primanota"); - ini.set("Campo0", m.get(F_NUMREG)); - ini.set("Campo1", m.get(F_DATAREG)); - ini.set("Descrizione", m.get(F_DESCR)); - - // prepara la sezione "DefinizioneDoc1" (se non esiste l'archivio mdb) - if (!archivio.exist()) - { - ini.set_paragraph("DefinizioneDoc1"); - ini.set("Archivio", archivio); - ini.set("NomeDoc", "Movimenti primanota"); - ini.set("DirDiArchiviazione", dir_di_arch); - ini.set("DriveDiArchiviazione", drv_di_arch); - ini.set("DirDocumento", "eddoc"); - ini.set("Campo0", "Numero registrazione"); - ini.set("Tipo0", "Numero"); - ini.set("Campo1", "Data registrazione"); - ini.set("Tipo1", "Data"); - } - } - - TExternal_app app(cmdline); - bool ok = app.run(FALSE, FALSE) == 0; - - if (ininame.not_empty()) - ::remove(ininame); - - return ok; -} - -bool TPrimanota_application::easydoc_handler(TMask_field& f, KEY k) -{ - if (k == K_SPACE) - { - const TMask& m = f.mask(); - if (m.insert_mode()) - app().run_easydoc("Scan"); - else - { - if (m.edit_mode()) - { - if (app().easydoc_connected()) - app().run_easydoc("Visualizza"); - else - app().run_easydoc("Scan"); - } - else - app().run_easydoc(""); - } - } - return TRUE; -} diff --git a/cg/cg4200.cpp b/cg/cg4200.cpp index d54f7c84d..c0da883e3 100755 --- a/cg/cg4200.cpp +++ b/cg/cg4200.cpp @@ -53,12 +53,13 @@ bool TCopia_archivi::copyfile(int logicnum, long from, long to) if (from > 0) set_firm(from); else prefix().set("com"); - TSystemisamfile file(logicnum); - TFilename t; t.tempdir(); t << "/tr" << logicnum; + + TFilename t; t.tempdir(); t << "/tr" << logicnum; + TSystemisamfile file(logicnum); - if (file.dump(t) != NOERR) - return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status()); - set_firm(to); + if (file.dump(t) != NOERR) + return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status()); + set_firm(to); TFilename s; s.tempdir(); s << "/sv" << logicnum; diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 3e3de3cd7..695b46a17 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -581,14 +581,14 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key) { if (key == K_TAB && f.focusdirty()) { - app().begin_wait(); + + TWait_cursor hourglass; app().reset_choices(f.mask()); app().set_year(f.get()); app().build_nomiditte(); app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ? (wht)atoi(f.mask().get(CG43_RDB_VERS)) : all); - app().end_wait(); } return TRUE; } @@ -731,13 +731,12 @@ bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key) const bool change = (app()._month != 13 && m == 13) || (app()._month == 13 && m != 13); if (change) { - app().begin_wait(); + TWait_cursor hourglass; app().reset_choices(f.mask()); app().set_month(m); app().build_ditte_sheet(f.mask().source_file() == "cg4300a.msk" ? (wht)atoi(f.mask().get(CG43_RDB_VERS)) : all); - app().end_wait(); } } return TRUE; diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index 0a2b79fc7..0dcc0f497 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -863,11 +863,10 @@ bool TStampa_registri_app::year_handler(TMask_field& f, KEY key) { if (key == K_TAB && f.focusdirty()) { - app().begin_wait(); + TWait_cursor hourglass; app().set_year(atoi(f.get())); app().build_nomiditte(); app().build_ditte_sheet(); - app().end_wait(); } return TRUE; } diff --git a/cg/cg4800.cpp b/cg/cg4800.cpp index dbffe0fce..d5679629d 100755 --- a/cg/cg4800.cpp +++ b/cg/cg4800.cpp @@ -143,11 +143,11 @@ bool VersAcc_app::ch_year_handler(TMask_field& f, KEY key) { if (key == K_TAB && f.focusdirty()) { - app().begin_wait(); + TWait_cursor hourglass; + app()._year = atoi(f.get()); app().build_nomiditte(); app().build_ditte_sheet(); - app().end_wait(); } return TRUE; } @@ -625,4 +625,4 @@ int cg4800(int argc, char* argv[]) VersAcc_app app; app.run(argc, argv, "Creazione versam. acconti dicembre"); return 0; -} +} \ No newline at end of file diff --git a/cg/cg4900.cpp b/cg/cg4900.cpp index 70fa0b0f1..3c447cf2b 100755 --- a/cg/cg4900.cpp +++ b/cg/cg4900.cpp @@ -246,12 +246,11 @@ bool LiqAcc_app::ch_year_handler(TMask_field& f, KEY key) { if (key == K_TAB && f.focusdirty()) { - app().begin_wait(); + TWait_cursor hourglass; app()._year = atoi(f.get()); app().build_nomiditte(); app().build_ditte_sheet(); app().reset_fields(); - app().end_wait(); } return TRUE; } diff --git a/cg/cg5500.cpp b/cg/cg5500.cpp index 21e82b2d9..a1ff6a7bc 100755 --- a/cg/cg5500.cpp +++ b/cg/cg5500.cpp @@ -106,9 +106,6 @@ bool Visliq_app::destroy() delete _del_tipo; delete _del_mese; delete _del_ditta; - delete _lim_r; - delete _lam_r; - delete _del_r; delete _lim; delete _lam; delete _del; diff --git a/cg/cg5600.cpp b/cg/cg5600.cpp index 2424673df..20b3be338 100755 --- a/cg/cg5600.cpp +++ b/cg/cg5600.cpp @@ -51,11 +51,10 @@ bool TRipristino_liq::ch_year_handler(TMask_field& f, KEY key) { if (key == K_TAB && f.focusdirty()) { - app().begin_wait(); + TWait_cursor hourglass; app().set_year(f.get()); app().build_nomiditte(); app().build_ditte_sheet(); - app().end_wait(); } return TRUE; } diff --git a/cg/cgmenu.men b/cg/cgmenu.men index 94c8cd5fd..e57ba6000 100755 --- a/cg/cgmenu.men +++ b/cg/cgmenu.men @@ -64,7 +64,7 @@ Item_05 = "Clienti/Fornitori", "cg0 -1", "F" Item_06 = "Agenti", "pr0 -4", "" Item_07 = "Cambi giornalieri", "ba3 -0 cam", "" Item_08 = "Esercizi", "cg0 -5 esc", "F" -Item_09 = "Commesse", "ba3 -0 cms", "" +Item_09 = "CDC/Commesse", "ba3 -0 cms", "" Item_10 = "Fasi commesse", "ba3 -0 fsc", "" [CGMENU_008] @@ -78,6 +78,8 @@ Item_03 = "Causali", "cg1 -6", "F" Item_04 = "Clienti/Fornitori", "cg1 -1", "F" Item_05 = "Cambi giornalieri", "ba3 -1 cam", "" Item_06 = "IV direttiva CEE", "ba3 -7 D", "" +Item_07 = "CDC/Commesse", "ba3 -1 cms", "" +Item_08 = "Fasi commesse", "ba3 -1 fsc", "" [CGMENU_009] Caption = "Prima nota" diff --git a/db/dblib.cpp b/db/dblib.cpp index ea72c26db..9dd203390 100755 --- a/db/dblib.cpp +++ b/db/dblib.cpp @@ -441,7 +441,7 @@ TDistinta_expr::TDistinta_expr() #define TREE_SEPARATOR '~' const TRectype* TDistinta_tree::_curr = NULL; -TToken_string TDistinta_tree::_tmp(80, TREE_SEPARATOR); + bool TDistinta_tree::isola_codice(TString& code) const @@ -455,8 +455,8 @@ bool TDistinta_tree::isola_codice(TString& code) const bool TDistinta_tree::father_code(TCodice_articolo& code) const { const int it = _path.items(); - _path.get(it - 2, _tmp); - isola_codice(_tmp); + _path.get(it - 2, (TString &)_tmp); + isola_codice((TString &)_tmp); code = _tmp; return code.not_empty(); } @@ -464,7 +464,7 @@ bool TDistinta_tree::father_code(TCodice_articolo& code) const bool TDistinta_tree::father_giaclev(TString& code, int levnum) const { const int it = _path.items(); - _path.get(it - 2, _tmp); + _path.get(it - 2, (TString &) _tmp); _tmp.get(1, code); if (levnum>0) code = livgiac().unpack_grpcode(code, levnum).trim(); @@ -473,15 +473,15 @@ bool TDistinta_tree::father_giaclev(TString& code, int levnum) const bool TDistinta_tree::path_code(TCodice_articolo& code, const TToken_string &path) const { - path.get(-2, _tmp); - isola_codice(_tmp); + path.get(-2, (TString &)_tmp); + isola_codice((TToken_string &)_tmp); code = _tmp; return code.not_empty(); } bool TDistinta_tree::path_giaclev(TString& code, int levnum, const TToken_string &path) const { - path.get(-2, _tmp); + path.get(-2, (TString &)_tmp); _tmp.get(1, code); if (levnum>0) code = livgiac().unpack_grpcode(code, levnum).trim(); @@ -490,20 +490,20 @@ bool TDistinta_tree::path_giaclev(TString& code, int levnum, const TToken_string int TDistinta_tree::curr_comp(TString& code) const { - _path.get(-2, _tmp); + _path.get(-2, (TString &)_tmp); _tmp.get(2, code); return atoi(code); } long TDistinta_tree::curr_sort() const { - _path.get(-2, _tmp); - return _tmp.get_long(3); + _path.get(-2, (TString &)_tmp); + return ((TToken_string &)_tmp).get_long(3); } const char* TDistinta_tree::curr_um(TCodice_um& code) const { - _path.get(-2, _tmp); + _path.get(-2, (TString &)_tmp); _tmp.get(4, code); return code; } @@ -522,8 +522,8 @@ real TDistinta_tree::last_qta(bool vis_ghost) const { for (int i = from ; i >= 0; i--) { - _path.get(i, _tmp); - if (_tmp.get_char(6) != 'G') + _path.get(i, (TString &)_tmp); + if (((TToken_string &)_tmp).get_char(6) != 'G') { from = i + 1; break; @@ -535,7 +535,7 @@ real TDistinta_tree::last_qta(bool vis_ghost) const for (int i = 0; i <= last; i++) { - _path.get(i, _tmp); + _path.get(i, (TString &) _tmp); _tmp.get(5, val); _tmp.get(0, art); _tmp.get(4, um); @@ -587,7 +587,7 @@ real TDistinta_tree::curr_qta() const TQuantita qta; for (int i = 0; i <= last; i++) { - _path.get(i, _tmp); + _path.get(i, (TString &) _tmp); _tmp.get(5, val); // if (i < last) _tmp.get(0, art); @@ -631,8 +631,8 @@ real TDistinta_tree::curr_qta() const char TDistinta_tree::path_type(const TToken_string & path) const { - path.get(-2, _tmp); - char ap = _tmp.get_char(6); + path.get(-2, (TString &)_tmp); + char ap = ((TToken_string &) _tmp).get_char(6); return ap; } @@ -643,8 +643,8 @@ int TDistinta_tree::path_depth(const TToken_string & path) const { for (int i = depth; i > 0; i--) { - path.get(i, _tmp); - char ap = _tmp.get_char(6); + path.get(i, (TString &)_tmp); + char ap = ((TToken_string &)_tmp).get_char(6); if (ap == 'G') depth--; } } @@ -715,7 +715,7 @@ TObject* TDistinta_tree::curr_node() const const TString& TDistinta_tree::describe(const TCodice_articolo& codart) const { - static TString80 descr; + TString & descr = get_tmp_string(); describe(codart, descr); return descr; } @@ -894,12 +894,12 @@ bool TDistinta_tree::is_cyclic(const TToken_string& path) const const int last = path.items()-1; if (last > 0) { - path.get(-2, _tmp); + path.get(-2, (TString &)_tmp); TCodice_articolo mycod; _tmp.get(0, mycod); mycod.trim(); for (int i = last-1; i >= 0; i--) { - path.get(i, _tmp); - isola_codice(_tmp); + path.get(i, (TString &)_tmp); + isola_codice((TToken_string &)_tmp); if (_tmp == mycod) { cyclic = TRUE; @@ -1393,7 +1393,7 @@ const TString& TDistinta_tree::get_string(const char* var) } if (strcmp(var, "_RADICE")==0) { - static TString80 _codice; + TString & _codice = get_tmp_string(); _codice = _root; isola_codice(_codice); return _codice; @@ -1695,8 +1695,8 @@ TCodgiac_livelli &TDistinta_tree::livgiac() const } TDistinta_tree::TDistinta_tree() : _sort(0), _max_depth(0), _ignore_ghost(FALSE), -// _vars("VAR", "B0"), _mag(LF_ANAMAG, "DESCR"), _lav("LAV"), - _livgiac(NULL),_qta_on_descr(FALSE),_descr_sep('-') + _livgiac(NULL),_qta_on_descr(FALSE),_descr_sep('-'), + _tmp(80, TREE_SEPARATOR) { memset(_livgiac_on_descr, 0, sizeof(_livgiac_on_descr)); } @@ -1780,7 +1780,7 @@ void TRiga_esplosione::init(const TDistinta_tree& tree, bool vis_ghost) const char * TRiga_esplosione::father(const char * types) { - static TString _tmp_path; + TString & _tmp_path = get_tmp_string(); _tmp_path = _path; while (TRUE) diff --git a/db/dblib.h b/db/dblib.h index 7f42f1003..aa93626fc 100755 --- a/db/dblib.h +++ b/db/dblib.h @@ -247,7 +247,7 @@ class TDistinta_tree : public TBidirectional_tree TCodgiac_livelli *_livgiac; static const TRectype* _curr; - static TToken_string _tmp; + TToken_string _tmp; TStack _stack; TAssoc_array _globals; diff --git a/ve/ve1100.cpp b/ve/ve1100.cpp index 050c64902..0ba90d5d7 100755 --- a/ve/ve1100.cpp +++ b/ve/ve1100.cpp @@ -1559,10 +1559,9 @@ bool TStampaDoc_application::tipocf_handler(TMask_field& f, KEY key) { if (f.to_check(key) && key == K_TAB) { - app().begin_wait(); + TWait_cursor hourglass; app().reset_choices(f.mask()); app().build_clifo_list(f.get()[0]); - app().end_wait(); } return TRUE; } diff --git a/ve/vearea.men b/ve/vearea.men index a4af90a44..88aa8c0a8 100755 --- a/ve/vearea.men +++ b/ve/vearea.men @@ -132,6 +132,8 @@ Item_09 = "Lingue", "ba3 -1 %lng", "" Item_10 = "Divise", "ba3 -1 %val", "" Item_11 = "Cambi giornalieri", "ba3 -1 CAM", "F" Item_12 = "Esercizi", "ba3 -1 esc", "F" +Item_13 = "CDC/Commesse", "ba3 -1 cms", "F" +Item_14 = "Fasi commesse", "ba3 -1 fsc", "F" [ACQVEN_011] Caption = "Stampa tabelle magazzino" diff --git a/ve/velib03.cpp b/ve/velib03.cpp index da791fe93..3a58d8702 100755 --- a/ve/velib03.cpp +++ b/ve/velib03.cpp @@ -442,7 +442,7 @@ public: virtual ~TAgenti_cache() { } }; -HIDDEN TAgenti_cache _agenti; +HIDDEN TAgenti_cache * _agenti = NULL; /////////////////////////////////////////////////////////// // Documento per vendite @@ -2307,8 +2307,10 @@ TOccasionale & TDocumento::occas() const } const TAgente & TDocumento::agente() const -{ - return _agenti.agente(get(DOC_CODAG)); +{ + if (_agenti == NULL) + _agenti = new TAgenti_cache; + return _agenti->agente(get(DOC_CODAG)); } TDocumento & TDocumento::copy(const TDocumento & d) diff --git a/ve/velib03a.cpp b/ve/velib03a.cpp index 100d322e3..29ba0b105 100755 --- a/ve/velib03a.cpp +++ b/ve/velib03a.cpp @@ -732,7 +732,7 @@ void TExpr_documento::evaluate_user_func(int index, int nparms, TEval_stack & st if (spesa) { - const bool tipo_rit = _row->spesa().tipo_ritenuta(); + const bool tipo_rit = _row->spesa().tipo_ritenuta() != 0; if (tipo_rit != '\0') { diff --git a/xi/xi2.c b/xi/xi2.c index 7bf8fee6f..8e1bd4ded 100755 --- a/xi/xi2.c +++ b/xi/xi2.c @@ -1522,8 +1522,8 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data ) send_cb = TRUE; break; case LM_CB_SELECT: - { - if ( lm_cb_data->row == 255 && lm_cb_data->column == 255 ) + { + if ( lm_cb_data->row == 255 && lm_cb_data->column == 255 ) { xiev.type = XIE_SELECT; xiev.v.select.xi_obj = lm_obj; @@ -1551,8 +1551,11 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data ) else { XI_OBJ row_obj; - XI_MAKE_ROW( &row_obj, lm_obj, lm_cb_data->row ); + + if (row_obj.parent == NULL) + xvt_debug_printf("AGA: lost parent"); + xiev.type = XIE_SELECT; xiev.v.select.xi_obj = &row_obj; xiev.v.select.selected = lm_cb_data->v.select.selected; diff --git a/xvaga/agasys.cpp b/xvaga/agasys.cpp index e27ca9197..ba6213205 100755 --- a/xvaga/agasys.cpp +++ b/xvaga/agasys.cpp @@ -318,6 +318,9 @@ static unsigned long ComputeCRC(const char* strFile) static void AddFileToZip(const wxString& strPrefix, const wxString& strFile, wxFFileOutputStream& fout, wxFFileOutputStream& fdir) { + if (!wxFileExists(strFile)) + return; + wxString strPath, strName, strExt; wxSplitPath(strFile, &strPath, &strName, &strExt); @@ -334,25 +337,27 @@ static void AddFileToZip(const wxString& strPrefix, const wxString& strFile, const unsigned long dwLocalSignature = 0x04034B50; fout.Write(&dwLocalSignature, sizeof(dwLocalSignature)); // Scrivo PK34 ZipLocalFileHeader zlfh; memset(&zlfh, 0, sizeof(zlfh)); - zlfh.nVersionNeeded = 0x10; // You need at least pkunzip 1.0 + zlfh.nVersionNeeded = 20; // You need at least pkunzip 2.0 + zlfh.nFlags = 0x0002; // Deep Hacking ??? zlfh.nMethod = 8; // Implode zlfh.nNameLength = strRelName.Length(); fout.Write(&zlfh, sizeof(zlfh)); // Scrivo header azzerato fout.Write((const char*)strRelName, zlfh.nNameLength); // Scrivo nome file const off_t nDataStart = fout.TellO(); // Memorizzo posizione dati compressi - if (wxFileExists(strFile)) + const int nMagicOffset = -4; // Deep hacking :-) + { wxFFileInputStream fin(strFile); - AgaZlibOutputStream zout(fout, zlfh.nMethod); + AgaZlibOutputStream zout(fout, 9); zout.Write(fin); // Scrivo file compresso zlfh.dwUncompressedSize = fin.TellI(); } - const int nMagicOffset = -5; // Deep hacking :-) fout.SeekO(nMagicOffset, wxFromEnd); - zlfh.dwCompressedSize = fout.TellO() - nDataStart; + zlfh.dwCompressedSize = fout.TellO(); + zlfh.dwCompressedSize -= nDataStart; zlfh.dwCRC = ComputeCRC(strFile); const time_t tMod = ::wxFileModificationTime(strFile); @@ -365,11 +370,11 @@ static void AddFileToZip(const wxString& strPrefix, const wxString& strFile, fout.SeekO(nStartPos+sizeof(dwLocalSignature), wxFromStart); fout.Write(&zlfh, sizeof(zlfh)); - fout.Write((const char*)strRelName, strRelName.Length()); +// fout.Write((const char*)strRelName, strRelName.Length()); - // Deep Hacking Here! - const wxByte pkHeader = 0x2b; - fout.Write(&pkHeader, 1); +// Deep Hacking Here! +// const wxByte pkHeader = 0x85; +// fout.Write(&pkHeader, 1); fout.SeekO(nMagicOffset, wxFromEnd); @@ -436,12 +441,13 @@ bool aga_zip(const char* srcfiles, const char* zipfile) wxStringList aFiles; AddFilesToList(strBase, strMask, aFiles); + return AddFilesToZip(strBase, aFiles, zipfile); } bool aga_zip_filelist(const char* filelist, const char* zipfile) { - wxStringList aFiles; + wxStringList aFiles; ifstream fin(filelist); while (!fin.eof()) { diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 17ffca3c4..6c5bc4584 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -17,7 +17,6 @@ // Funzione di utilita' MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m); - #ifdef WIN32 #include "oswin32.h" #endif @@ -233,7 +232,7 @@ void TwxCaret::Toggle() xvt_dwin_set_cpen(_owner, &pen); xvt_dwin_set_draw_mode(_owner, M_COPY); xvt_dwin_draw_set_pos(_owner, _pos); - PNT p = _pos; p.v -= _size.y; + PNT p = _pos; p.v -= _size.y-1; xvt_dwin_set_clip(_owner, NULL); // Non si mai! xvt_dwin_draw_line(_owner, p); @@ -675,6 +674,8 @@ void TwxWindow::DoXvtEvent(EVENT& e) void TwxWindow::OnChar(wxKeyEvent& event) { + static bool bDot2Comma = FALSE; + EVENT e; memset(&e, 0, sizeof(EVENT)); e.type = E_CHAR; int k = event.GetKeyCode(); @@ -683,9 +684,22 @@ void TwxWindow::OnChar(wxKeyEvent& event) { case WXK_ALT: case WXK_MENU: + case WXK_NUMPAD0: + case WXK_NUMPAD1: + case WXK_NUMPAD2: + case WXK_NUMPAD3: + case WXK_NUMPAD4: + case WXK_NUMPAD5: + case WXK_NUMPAD6: + case WXK_NUMPAD7: + case WXK_NUMPAD8: + case WXK_NUMPAD9: + event.Skip(); + return; case WXK_NUMPAD_DECIMAL: // ??? Non arriva mai case WXK_DECIMAL: // ??? Arriva sia '.' sia WXK_DECIMAL=340 event.Skip(); + bDot2Comma = TRUE; return; case WXK_DOWN : k = K_DOWN; break; case WXK_LEFT : k = K_LEFT; break; @@ -697,6 +711,13 @@ void TwxWindow::OnChar(wxKeyEvent& event) if (event.ShiftDown()) k = K_BTAB; break; + case '.': + if (bDot2Comma) + { + k = ','; + bDot2Comma = FALSE; + } + break; default: if (k >= WXK_F1 && k <= WXK_F24) k = K_F1 + k - WXK_F1; @@ -1762,12 +1783,11 @@ void xvt_dwin_draw_line(WINDOW win, PNT pnt) void xvt_dwin_update(WINDOW win) { -/* + // "sembra" che non serva ad un fico secco, ma serve! #ifdef WIN32 CAST_TWIN(win, w); - OsWin32_UpdateWindow(w.GetHWND()); // "sembra" che non serva ad un fico secco + OsWin32_UpdateWindow(w.GetHWND()); #endif -*/ } /////////////////////////////////////////////////////////// @@ -2148,7 +2168,7 @@ XVT_IMAGE xvt_image_read(const char* filenamep) XVT_IMAGE xvt_image_read_bmp(const char *filenamep) { - return xvt_image_read(filenamep); + return xvt_image_read(filenamep); // Very clever! } void xvt_image_set_clut(XVT_IMAGE image, short index, COLOR color) @@ -2668,7 +2688,9 @@ void xvt_sbar_set_range(WINDOW win, SCROLL_TYPE t, int min, int max) /////////////////////////////////////////////////////////// void xvt_scr_beep(void) -{ wxBell(); } +{ + wxBell(); +} WINDOW xvt_scr_get_focus_topwin(void) {