diff --git a/ba/ba1400.cpp b/ba/ba1400.cpp index cdf7a689b..094d555a1 100755 --- a/ba/ba1400.cpp +++ b/ba/ba1400.cpp @@ -20,15 +20,19 @@ class TMenu_item : public TString TString _cmd; public: - TObject* dup() const { return new TMenu_item(*this); } - + virtual TObject* dup() const { return new TMenu_item(*this); } const TString& cmd() const { return _cmd; } TString& cmd() { return _cmd; } + TMenu_item(const TMenu_item& mi); TMenu_item(const char* line); virtual ~TMenu_item() { } }; +TMenu_item::TMenu_item(const TMenu_item& mi) + : _cmd(mi._cmd) +{ set(*this); } + TMenu_item::TMenu_item(const char* line) { TToken_string ts(line, ','); @@ -152,16 +156,14 @@ protected: protected: virtual bool user_create(); virtual bool user_destroy(); - virtual TMask* get_mask(int mode) { return _msk;} - virtual bool changing_mask(int mode) { return FALSE;} - virtual TRelation* get_relation() const { return _rel;} + virtual TMask* get_mask(int mode) { return _msk; } + virtual bool changing_mask(int mode) { return FALSE; } + virtual TRelation* get_relation() const { return _rel; } virtual int read(TMask& m); virtual void init_query_mode(TMask& m); virtual void init_modify_mode(TMask& m); - virtual void init_insert_mode(TMask& m) { - build_sheet(NULL); - } + virtual void init_insert_mode(TMask& m) { build_sheet(NULL); } protected: virtual void put_in_record(const TMask& m); @@ -183,6 +185,7 @@ public: class TSet_users : public TSet_user_passwd { TMenu* _tree; + protected: virtual bool user_create(); virtual bool user_destroy(); @@ -192,27 +195,21 @@ protected: virtual int read(TMask& m); virtual bool remove(); - virtual void init_query_mode(TMask& m) { enable_aut();} + virtual void init_query_mode(TMask& m) { enable_aut(); } virtual void init_insert_mode(TMask& m) { build_sheet(NULL); } virtual void init_modify_mode(TMask& m) { enable_aut();} protected: -// TSheet_field& sheet_field() { return _msk->sfield(F_MODULI); } -// void build_sheet(const TRectype* r); void build_tree(const TRectype* r); -// void enable_aut(); virtual void put_in_record(const TMask& m); static bool user_handler(TMask_field& f, KEY key); static bool group_handler(TMask_field& f, KEY key); -// static bool password_handler(TMask_field& f, KEY key); static bool k_notify(TSheet_field & f, int r, KEY k); static bool tree_handler(TMask_field& f, KEY key); static bool p_notify(TSheet_field & f, int r, KEY k); public: -// bool user_has_module(int mod); - TSet_users() : TSet_user_passwd() , _tree(NULL) {} }; @@ -420,7 +417,8 @@ bool TSet_user_passwd::password_handler(TMask_field& f, KEY key) if (f.mask().query_mode() || key != K_ENTER) return TRUE; const bool ok = f.get().len() > 3 && f.get().find(' ') < 0; - if (!ok) return f.error_box("La password deve essere lunga almeno 4 caratteri e non contenere spazi"); + if (!ok) + return f.error_box(TR("La password deve essere lunga almeno 4 caratteri e non contenere spazi")); return ok; } @@ -493,7 +491,7 @@ bool TSet_users::p_notify(TSheet_field& f, int r, KEY k) { TMask& m = f.mask(); if (m.get(F_APPLICAT).empty()) - return error_box("Nessun programma selezionato"); + return error_box(TR("Nessun programma selezionato")); } default: break; @@ -673,7 +671,7 @@ void TSet_user_passwd::put_in_record(const TMask& m) if (_msk->get(F_USER) == user()) r.put("PASSWORD", s); else - error_box("Impossibile cambiare la password di altri utenti"); + error_box(TR("Impossibile cambiare la password di altri utenti")); } void TSet_users::put_in_record(const TMask& m) @@ -785,10 +783,12 @@ int ba1400(int argc, char** argv) { if (user() == ::dongle().administrator()) { - TSet_users a ; + TSet_users a; a.run(argc, argv, TR("Configurazione utenti")); - } else { - TSet_user_passwd a ; + } + else + { + TSet_user_passwd a; a.run(argc, argv, TR("Configurazione utenti")); } return 0; diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index 0b93ed8f4..62eb467f8 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -257,7 +257,7 @@ bool TStampa_bilanci::mask_anno(TMask_field& f, KEY k) if (tipo_stampa == 2) if (anno == 0) { - f.error_box("Indicare l'anno di esercizio"); + f.error_box(TR("Indicare l'anno di esercizio")); return FALSE; } } @@ -411,7 +411,7 @@ bool TStampa_bilanci::mask_datalim (TMask_field& f, KEY k) { if (!IsEsercizio(datalim,anno)) { - f.error_box ("La data limite deve appartenere all'esercizio indicato"); + f.error_box (TR("La data limite deve appartenere all'esercizio indicato")); return FALSE; } } @@ -422,16 +422,15 @@ bool TStampa_bilanci::mask_datalim (TMask_field& f, KEY k) { if (!datalim.ok()) { - f.error_box ("La data limite e' obbligatoria"); + f.error_box (TR("La data limite e' obbligatoria")); return FALSE; } long anno = app().date2esc(datalim); if (anno == 0) { - f.error_box ("La data limite deve appartenere ad un esercizio attivo della ditta"); + f.error_box (TR("La data limite deve appartenere ad un esercizio attivo della ditta")); return FALSE; } - //f.mask().set(F_ANNO,anno); } } return TRUE; @@ -477,7 +476,7 @@ bool TStampa_bilanci::mask_date(TMask_field& f, KEY k) { if (!IsEsercizio(data,anno)) { - f.error_box("La data indicata deve essere all'interno dell'esercizio"); + f.error_box(TR("La data indicata deve essere all'interno dell'esercizio")); return FALSE; } } @@ -494,7 +493,7 @@ bool TStampa_bilanci::mask_date(TMask_field& f, KEY k) { if ( !data.ok() ) { - f.error_box("Indicare una data appartenente ad un esercizio attivo della ditta"); + f.error_box(TR("Indicare una data appartenente ad un esercizio attivo della ditta")); return FALSE; } else @@ -505,15 +504,14 @@ bool TStampa_bilanci::mask_date(TMask_field& f, KEY k) app()._annoapp = app().date2esc(from); if ( app()._annoapp != app().date2esc(data) ) { - f.error_box("Le date devono appartenere ad uno stesso esercizio attivo della ditta"); + f.error_box(TR("Le date devono appartenere ad uno stesso esercizio attivo della ditta")); return FALSE; } if (from > data) { - f.error_box("La data limite inferiore non puo' essere maggiore della data limite superiore"); + f.error_box(TR("La data limite inferiore non puo' essere maggiore della data limite superiore")); return FALSE; } - //f.mask().set(F_ANNO, anno); } } } @@ -536,7 +534,6 @@ bool TStampa_bilanci::verifica_handler(TMask_field& f, KEY k) f.mask().show (F_STAMPAV); f.mask().show (F_DATADA); f.mask().show (F_DATAA); - //f.mask().show (F_STAMPAMPROV); } if ( (tipo_stampa == 1) && (verifica == 3) ) { @@ -546,7 +543,6 @@ bool TStampa_bilanci::verifica_handler(TMask_field& f, KEY k) f.mask().show (F_DATADA); f.mask().show (F_DATAA); f.mask().hide (F_STAMPAV); - //f.mask().show (F_STAMPAMPROV); } if ( (tipo_stampa == 2) && ((verifica == 1)||(verifica == 2)) ) { @@ -555,7 +551,6 @@ bool TStampa_bilanci::verifica_handler(TMask_field& f, KEY k) f.mask().hide (F_ORDINAMENTO); f.mask().hide (F_DATADA); f.mask().hide (F_DATAA); - //f.mask().hide (F_STAMPAMPROV); f.mask().show (F_STAMPAV); } if ( (tipo_stampa == 2) && (verifica == 3) ) @@ -565,7 +560,6 @@ bool TStampa_bilanci::verifica_handler(TMask_field& f, KEY k) f.mask().show (F_ORDINAMENTO); f.mask().hide (F_DATADA); f.mask().hide (F_DATAA); - //f.mask().hide (F_STAMPAMPROV); f.mask().hide (F_STAMPAV); } } @@ -947,7 +941,7 @@ bool TStampa_bilanci::bil_sez_contr() if (indbil_conto <= 0) // Warning per Roberto! { - yesnofatal_box("Indicatore di bilancio %d nel conto %03d %03d", indbil_conto, + yesnofatal_box(FR("Indicatore di bilancio %d nel conto %03d %03d"), indbil_conto, _pcn->get_int (PCN_GRUPPO), _pcn->get_int (PCN_CONTO)); indbil_conto = 1; } @@ -1046,15 +1040,11 @@ bool TStampa_bilanci::bil_sez_contr() _sottoc_dare = FALSE; _sottoc_avere = FALSE; - //error_box ("saldo = %s", saldo.string()); - if (saldo != ZERO) saldo = compensazione(compensa, indbil_conto, saldo); if (_indbil == 1 || _indbil == 2) { - //real app = sld.saldoini(); - //bool flag = sld.flagprec(); if (flag) { if (app > ZERO) @@ -1530,29 +1520,14 @@ bool TStampa_bilanci::bil_verifica() } } - //if (movimentato) - // saldo_iniziale = _saldo_ini_dare - _saldo_ini_avere; - //movimentato = calcola(g,c,s); - + if (movimentato || _stampav != 1) { - //saldo_iniziale = _saldo_ini_dare - _saldo_ini_avere; _nuovo_tot_saldo_d += _mov_periodo_dare; _nuovo_tot_saldo_a += _mov_periodo_avere; - //modifica del 21/11/1995 - /* - if (saldo_iniziale > ZERO) - _nuovo_tot_saldo_d += saldo_iniziale; - else - { - real app = -saldo_iniziale; - _nuovo_tot_saldo_a += app; - } - */ _nuovo_tot_saldo_d += _saldo_ini_dare; _nuovo_tot_saldo_a += _saldo_ini_avere; - //fine if (_datada == _dataini) saldo_finale = saldo_iniziale+_mov_periodo_dare-_mov_periodo_avere; @@ -1625,12 +1600,6 @@ bool TStampa_bilanci::bil_verifica() } } //modifica del 21/11/1995 - /* - if (saldo_iniziale < ZERO) - _saldo_ini_conto_avere += saldo_iniziale; - else - _saldo_ini_conto_dare += saldo_iniziale; - */ if (_tipo_stampa1 == 1 && _datada == _dataini) { _saldo_ini_conto_dare += _saldo_ini_dare; @@ -1664,8 +1633,6 @@ bool TStampa_bilanci::bil_verifica() //modifica del 21/11/1995 if (_datada == _dataini && _tipo_stampa1 == 1) { - //_tmp_saldi_att->put(SLD_PDARESCA,_saldo_ini_dare); - //_tmp_saldi_att->put(SLD_PAVERESCA,_saldo_ini_avere); _tmp_saldi_att->put(SLD_PDAREPRO,_saldo_ini_dare); // W96SALDI del 05-06-96 _tmp_saldi_att->put(SLD_PAVEREPRO,_saldo_ini_avere); } @@ -1673,19 +1640,15 @@ bool TStampa_bilanci::bil_verifica() { if (saldo_iniziale > ZERO) //va stampato in Dare _tmp_saldi_att->put(SLD_PDAREPRO,saldo_iniziale); // W96SALDI del 05-06-96 - //_tmp_saldi_att->put(SLD_PDARESCA,saldo_iniziale); else if (saldo_iniziale < ZERO) { saldo_iniziale = -saldo_iniziale; - //_tmp_saldi_att->put(SLD_PAVERESCA,saldo_iniziale); _tmp_saldi_att->put(SLD_PAVEREPRO,saldo_iniziale); // W96SALDI del 05-06-96 } } } else if (_datada > _dataini) { - //_tmp_saldi_att->put(SLD_PDARESCA,_prg_prec_dare); - //_tmp_saldi_att->put(SLD_PAVERESCA,_prg_prec_avere); _tmp_saldi_att->put(SLD_PDAREPRO,_prg_prec_dare); // W96SALDI del 05-06-96 _tmp_saldi_att->put(SLD_PAVEREPRO,_prg_prec_avere); } @@ -2013,8 +1976,6 @@ bool TStampa_bilanci::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_fin saldo_iniziale = sld.saldoini(); if (!movimentato) { - //if (_stampav == 1) - // continue; //vado sui saldi con l'anno precedente e calcolo saldo_finale es.prec //se esiste tale record e almeno un valore e' significativo (indipendentemente dal valore //del saldo iniziale calcolato, allora metto a TRUE il flag movimentato @@ -2093,8 +2054,6 @@ bool TStampa_bilanci::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_fin //modifica del 21/11/1995 if (_tipo_stampa1 == 1 && _datada == _dataini) { - //_tmp_saldi_att->put(SLD_PDARESCA,_saldo_ini_dare); - //_tmp_saldi_att->put(SLD_PAVERESCA,_saldo_ini_avere); _tmp_saldi_att->put(SLD_PDAREPRO,_saldo_ini_dare); // W96SALDI del 05-06-96 _tmp_saldi_att->put(SLD_PAVEREPRO,_saldo_ini_avere); } @@ -2102,19 +2061,15 @@ bool TStampa_bilanci::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_fin { if (saldo_iniziale > ZERO) //va stampato in Dare _tmp_saldi_att->put(SLD_PDAREPRO,saldo_iniziale); // W96SALDI del 05-06-96 - //_tmp_saldi_att->put(SLD_PDARESCA,saldo_iniziale); else if (saldo_iniziale < ZERO) { saldo_iniziale = -saldo_iniziale; - //_tmp_saldi_att->put(SLD_PAVERESCA,saldo_iniziale); _tmp_saldi_att->put(SLD_PAVEREPRO,saldo_iniziale); // W96SALDI del 05-06-96 } } } else if (_datada > _dataini) { - //_tmp_saldi_att->put(SLD_PDARESCA,_prg_prec_dare); - //_tmp_saldi_att->put(SLD_PAVERESCA,_prg_prec_avere); _tmp_saldi_att->put(SLD_PDAREPRO,_prg_prec_dare); // W96SALDI del 05-06-96 _tmp_saldi_att->put(SLD_PAVEREPRO,_prg_prec_avere); } @@ -2391,7 +2346,7 @@ void TStampa_bilanci::leggi_clifo(const TArray& gccf) _indbil = cerca_indbil(g,c); movimentato = calcola(g,c,codcf); if (_stampa_mov_prov != 3) - if (!movimentato /* && _stampac!=1 */) + if (!movimentato) if (_indbil == 1 || _indbil == 2 || _indbil == 5) if (_annoes != 0) //cioe' se sto ragionando per competenza { @@ -2449,9 +2404,6 @@ void TStampa_bilanci::leggi_clifo(const TArray& gccf) -_mov_periodo_avere; } } - //if (saldo_finale == ZERO) - // if (_stampac == 2) - // continue; //se saldo_finale < 0 verra' stampato con una A, se no con una D } @@ -2482,9 +2434,6 @@ void TStampa_bilanci::leggi_clifo(const TArray& gccf) saldo_finale = saldo_iniziale+_mov_periodo_dare-_mov_periodo_avere; } - //if (saldo_finale == ZERO) - // if (_stampac == 2) - // continue; } if (movimentato || _stampac != 1 || saldo_iniziale != ZERO) if (!(saldo_finale.is_zero() && _stampac == 2)) @@ -2560,7 +2509,7 @@ void TStampa_bilanci::crea_sort_clifo() //serve solo per la progind: stima alla meno peggio if (_situazione.empty()) ncur /= 2; long nitems = ncur*(_clienti.items()+_fornitori.items()); - _prog = new TProgind(nitems,"Elaborazione in corso... prego attendere",FALSE); + _prog = new TProgind(nitems,TR("Elaborazione in corso... prego attendere"),FALSE); _prog->addstatus(1); init_sort(); if (_situazione == "C") leggi_clifo(_clienti); @@ -2665,8 +2614,6 @@ bool TStampa_bilanci::preprocess_print(int file, int counter) else set_real_picture ("####.###.###.###"); - //if ( (_verifica == 3) && (_ordinamento == 1) ) - // _tmp_saldi_att->setkey(2); set_print_zero(FALSE); _cambiato_conto_1 = FALSE; _livello_conto = TRUE; @@ -2946,7 +2893,7 @@ void TStampa_bilanci::set_page(int file, int counter) if (!counter) { - set_row(_i++,"@29gATTIVITA'@94gPASSIVITA'"); + set_row(_i++,FR("@29gATTIVITA'@94gPASSIVITA'")); set_row(_i++,"@29g---------@94g----------"); set_row(_i++, dep); } @@ -2957,7 +2904,7 @@ void TStampa_bilanci::set_page(int file, int counter) if (!_salto_pagina) { printer().formfeed(); - set_row(_i++,"@29gCOSTI@94gRICAVI"); + set_row(_i++,FR("@29gCOSTI@94gRICAVI")); set_row(_i++,"@29g-----@94g------"); set_row(_i++, dep); _salto_pagina = TRUE; @@ -2974,13 +2921,12 @@ void TStampa_bilanci::set_page(int file, int counter) if (!_tmp_saldi_conti_uno->empty() || !_tmp_saldi_conti_due->empty()) { printer().formfeed(); - set_row(_i++,"@59gCONTI D'ORDINE"); + set_row(_i++,FR("@59gCONTI D'ORDINE")); set_row(_i++,"@59g--------------"); set_row(_i++, dep); if (_eof5 && _eof6) { _stampato = TRUE; - //stampa_totali(); stampa_totali_uno(_prg_inidare_ord,_prg_iniavere_ord); } } @@ -2994,7 +2940,6 @@ void TStampa_bilanci::set_page(int file, int counter) controlla_conto(_eof5,_eof6); if (_eof5 && _eof6) if (!_stampato) - //stampa_totali(); stampa_totali_uno(_prg_inidare_ord,_prg_iniavere_ord); } } @@ -3278,7 +3223,6 @@ void TStampa_bilanci::stampa_riga_totali(int r) } //modifica del 21/11/1995 - //if (_datada == _dataini) //colonna saldo iniziale if (_tipo_stampa1 == 2) { real r = _saldo_dare_tot - _saldo_avere_tot; @@ -3303,7 +3247,7 @@ void TStampa_bilanci::stampa_riga_totali(int r) { if (_stampa_width == 132) { - set_row(r,"***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@115g%r",&_saldo_dare_tot,&_saldo_avere_tot,&_mov_dare_tot, + set_row(r,FR("***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@115g%r"),&_saldo_dare_tot,&_saldo_avere_tot,&_mov_dare_tot, &_mov_avere_tot,&_saldo_finale_tot); if (_saldo_finale_tot != ZERO) set_row(r,"@131g%c", app); @@ -3311,10 +3255,10 @@ void TStampa_bilanci::stampa_riga_totali(int r) else { if (app == 'D') - set_row(r,"***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!%r@148g!",&_saldo_dare_tot,&_saldo_avere_tot, + set_row(r,FR("***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!%r@148g!"),&_saldo_dare_tot,&_saldo_avere_tot, &_mov_dare_tot,&_mov_avere_tot,&_saldo_finale_tot); else - set_row(r,"***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@132g%r@148g!",&_saldo_dare_tot,&_saldo_avere_tot, + set_row(r,FR("***@8gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@132g%r@148g!"),&_saldo_dare_tot,&_saldo_avere_tot, &_mov_dare_tot,&_mov_avere_tot,&_saldo_finale_tot); } } @@ -3322,7 +3266,7 @@ void TStampa_bilanci::stampa_riga_totali(int r) { if (_stampa_width == 132) { - set_row(r,"@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@115g%r",&_saldo_dare_tot,&_saldo_avere_tot, + set_row(r,FR("@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@115g%r"),&_saldo_dare_tot,&_saldo_avere_tot, &_mov_dare_tot,&_mov_avere_tot,&_saldo_finale_tot); if (_saldo_finale_tot != ZERO) set_row(r,"@131g%c", app); @@ -3334,9 +3278,9 @@ void TStampa_bilanci::stampa_riga_totali(int r) { //modifica del 21/11/1995 if (_tipo_stampa1 == 2) - set_row(r,"@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!",&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); else - set_row(r,"@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!",&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); //fine } } @@ -3345,12 +3289,12 @@ void TStampa_bilanci::stampa_riga_totali(int r) { if (app == 'D') { - set_row(r++,"@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!%r@148g!",&_saldo_dare_tot, + set_row(r++,FR("@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!%r@148g!"),&_saldo_dare_tot, &_saldo_avere_tot,&_mov_dare_tot,&_mov_avere_tot, &_saldo_finale_tot); } else { - set_row(r++,"@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@132g%r@148g!",&_saldo_dare_tot, + set_row(r++,FR("@1g****** ********@17gTOTALE GENERALE@46g!%r@64g%r@80g!%r@98g%r@114g!@132g%r@148g!"),&_saldo_dare_tot, &_saldo_avere_tot,&_mov_dare_tot,&_mov_avere_tot, &_saldo_finale_tot); } @@ -3359,9 +3303,9 @@ void TStampa_bilanci::stampa_riga_totali(int r) if ((_tipo_stampa1 == 1 && _datada == _dataini) || _tipo_stampa1 == 2) { if (_tipo_stampa1 == 2) - set_row(r,"@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!@148g!",&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); else - set_row(r,"@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!@148g!",&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); } } } @@ -3394,19 +3338,19 @@ void TStampa_bilanci::stampa_totali() set_row(_i++, (const char*)dep); TString pal; total2string(_tot_dare, pal); TString bal; total2string(_tot_avere, bal); - set_row(_i++, "@39gTOTALE@48g%s@102gTOTALE@113g%s", + set_row(_i++, FR("@39gTOTALE@48g%s@102gTOTALE@113g%s"), (const char*)pal, (const char*)bal); TString sb; total2string(sbilancio, sb); TString pa; total2string(pareggio, pa); if (_tot_dare > _tot_avere) { - set_row(_i++, "@80gSBILANCIO ESERCIZIO IN CORSO@113g%s", (const char*)sb); - set_row(_i++, "@91gTOTALE A PAREGGIO@113g%s",(const char*)pa); + set_row(_i++, FR("@80gSBILANCIO ESERCIZIO IN CORSO@113g%s"), (const char*)sb); + set_row(_i++, FR("@91gTOTALE A PAREGGIO@113g%s"),(const char*)pa); } if (_tot_dare < _tot_avere) { - set_row(_i++, "@17gSBILANCIO ESERCIZIO IN CORSO@48g%s", (const char*)sb); - set_row(_i++, "@28gTOTALE A PAREGGIO@48g%s",(const char*)pa); + set_row(_i++, FR("@17gSBILANCIO ESERCIZIO IN CORSO@48g%s"), (const char*)sb); + set_row(_i++, FR("@28gTOTALE A PAREGGIO@48g%s"),(const char*)pa); } _tot_dare = ZERO; _tot_avere = ZERO; @@ -3418,18 +3362,7 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) real pareggio; real sbilancio = _tot_dare - r1 - (_tot_avere - r2); real sbilprec = r2 - r1; - /* - if (sbilancio > ZERO) //ho un utile => va stampato tra le passivita' - { - sbilprec = -sbilprec; - pareggio = _tot_avere + sbilancio + sbilprec; - } - else if (sbilancio < ZERO) //ho una perdita => va stampato tra le attivita' cambiato di segno - { - sbilancio = -sbilancio; - pareggio = _tot_dare + sbilancio + sbilprec; - } - */ + if (_prima_volta) //ho finito di stampare le attivita'/passivita' _prima_volta = FALSE; else @@ -3445,7 +3378,7 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) set_row(_i++, (const char*)dep); TString pal; total2string(_tot_dare, pal); TString bal; total2string(_tot_avere, bal); - set_row(_i++, "@39gTOTALE@48g%s@102gTOTALE@113g%s", + set_row(_i++, FR("@39gTOTALE@48g%s@102gTOTALE@113g%s"), (const char*)pal, (const char*)bal); if (sbilancio > ZERO) //ho un utile => va stampato tra le passivita' { @@ -3454,14 +3387,14 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) if (sbilprec != ZERO) { TString sb; total2string(sbilprec, sb); - set_row(_i++, "@83gSBILANCIO ESERCIZIO PRECEDENTE@113g%s", + set_row(_i++, FR("@83gSBILANCIO ESERCIZIO PRECEDENTE@113g%s"), (const char*)sb); } TString pal; total2string(sbilancio, pal); TString bal; total2string(pareggio, bal); - set_row(_i++, "@80gSBILANCIO ESERCIZIO IN CORSO@113g%s", + set_row(_i++, FR("@80gSBILANCIO ESERCIZIO IN CORSO@113g%s"), (const char*)pal); - set_row(_i++, "@91gTOTALE A PAREGGIO@113g%s",(const char*)bal); + set_row(_i++, FR("@91gTOTALE A PAREGGIO@113g%s"),(const char*)bal); } else if (sbilancio < ZERO) //ho una perdita => va stampato tra le attivita' { @@ -3470,15 +3403,15 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) if (sbilprec != ZERO) { TString sb; total2string(sbilprec, sb); - set_row(_i++, "@15gSBILANCIO ESERCIZIO PRECEDENTE@48g%s", + set_row(_i++, FR("@15gSBILANCIO ESERCIZIO PRECEDENTE@48g%s"), (const char*)sb); } TString pal; total2string(sbilancio, pal); TString bal; total2string(pareggio, bal); - set_row(_i++, "@17gSBILANCIO ESERCIZIO IN CORSO@48g%s", + set_row(_i++, FR("@17gSBILANCIO ESERCIZIO IN CORSO@48g%s"), (const char*)pal); - set_row(_i++, "@28gTOTALE A PAREGGIO@48g%s",(const char*)bal); + set_row(_i++, FR("@28gTOTALE A PAREGGIO@48g%s"),(const char*)bal); } else //sbilancio es. in corso == 0 { @@ -3488,9 +3421,9 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) TString pal; total2string(sbilprec, pal); pareggio = _tot_avere + sbilprec; TString bal; total2string(pareggio, bal); - set_row(_i++, "@83gSBILANCIO ESERCIZIO PRECEDENTE@113g%s", + set_row(_i++, FR("@83gSBILANCIO ESERCIZIO PRECEDENTE@113g%s"), (const char*)pal); - set_row(_i++, "@96gTOTALE A PAREGGIO@113g%s", (const char*)bal); + set_row(_i++, FR("@96gTOTALE A PAREGGIO@113g%s"), (const char*)bal); } else if (sbilprec < ZERO) { @@ -3498,8 +3431,8 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2) pareggio = _tot_dare + sbilprec; TString pal; total2string(sbilprec, pal); TString bal; total2string(pareggio, bal); - set_row(_i++, "@15gSBILANCIO ESERCIZIO PRECEDENTE@48g%s", (const char*)pal); - set_row(_i++, "@28gTOTALE A PAREGGIO@48g%s", (const char*)bal); + set_row(_i++, FR("@15gSBILANCIO ESERCIZIO PRECEDENTE@48g%s"), (const char*)pal); + set_row(_i++, FR("@28gTOTALE A PAREGGIO@48g%s"), (const char*)bal); } } _tot_dare = ZERO; @@ -3565,18 +3498,13 @@ void TStampa_bilanci::stampa_seconda_colonna(int g, int c, long s, { if (!_totali) { -// if (c != 0 && s == 0) -// set_row(_i, "@68g%c@69g%-.43s @114g%r", dep, desc, &saldo); -// else set_row(_i, "@68g%c@69g%-.47s @114g%r", dep, desc, &saldo); } - else if ( !(c == 0 && s == 0) ) - { -// if (s == 0) //se e' un conto -// set_row(_i, "@68g%c @69g%-.43s @114g%r", dep, desc, &saldo); -// else - set_row(_i, "@68g%c @69g%-.47s @114g%r", dep, desc, &saldo); - } + else + if ( !(c == 0 && s == 0) ) + { + set_row(_i, "@68g%c @69g%-.47s @114g%r", dep, desc, &saldo); + } } else { @@ -3784,7 +3712,7 @@ void TStampa_bilanci::stampa_un_bilancio(const TMask& m) if (_bilancio == 1) { printer().footerlen(3); - _prog = new TProgind(_pcn->items(),"Elaborazione in corso...",FALSE); + _prog = new TProgind(_pcn->items(),TR("Elaborazione in corso..."),FALSE); _totali = m.get_bool(F_TOTALI); _codici = m.get_bool(F_CODICI); _saldo = m.get_bool(F_SALDO); @@ -3804,7 +3732,6 @@ void TStampa_bilanci::stampa_un_bilancio(const TMask& m) _dataini = InizioEsercizio(_annoes); else _dataini = _inizioEs; - //_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X"); } bil_sez_contr(); } @@ -3815,7 +3742,7 @@ void TStampa_bilanci::stampa_un_bilancio(const TMask& m) _verifica = m.get_int(F_VERIFICA); if ( (_verifica == 1)||(_verifica == 2) ) - _prog = new TProgind(_pcn->items(),"Elaborazione in corso...",FALSE); + _prog = new TProgind(_pcn->items(),TR("Elaborazione in corso..."),FALSE); _tipo_stampa1 = m.get_int(F_STAMPA1); if (_tipo_stampa1 == 1) { @@ -3993,15 +3920,15 @@ int TStampa_bilanci::stampa_intestazione_ditta() get_dati_ditta(); codice_ditta << get_firm(); - set_header (r++, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta, + set_header (r++, "%s %s %s %s %s %s %s", TR("Ditta"), (const char*)codice_ditta, (const char*)_ragsoc, (const char*)_viafis, (const char*)_cap, (const char*)_comunefis, (const char*)_provfis); printer().setdate(_data); - riga = "Data @> Pag. @#"; + riga = TR("Data") ; riga << " @> " << TR("Pag.") << " @#"; riga.right_just(_stampa_width-10); - riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi)); + riga.overwrite (format("%s %s %s %s", TR("Partita iva"), (const char*)_paiva, TR("Codice fiscale"), (const char*)_cofi)); set_header (r++, "%s", (const char*) riga); return r; @@ -4015,12 +3942,12 @@ void TStampa_bilanci::header_cdc(int& r) if (_fsc.not_empty()) { const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header(r++, "@bCommessa %s %s - Fase %s %s", - (const char*)_cdc, (const char*)desc_cdc, + set_header(r++, "@b%s %s %s - %s %s %s", TR("Commessa"), + (const char*)_cdc, (const char*)desc_cdc, TR("Fase"), (const char*)_fsc, (const char*)desc_fsc); } else - set_header(r++, "@bCommessa %s %s", (const char*)_cdc, (const char*)desc_cdc); + set_header(r++, "@b%s %s %s", TR("Commessa"), (const char*)_cdc, (const char*)desc_cdc); } } @@ -4038,24 +3965,24 @@ void TStampa_bilanci::preprocess_header() TString data; TString data_lim = _datalim.string(); - set_header(r, "STAMPA BILANCIO A SEZIONI CONTRAPPOSTE"); + set_header(r, TR("STAMPA BILANCIO A SEZIONI CONTRAPPOSTE")); if (_tipo_stampa == 1) { data_da = _dataini.string(); data = _datalim.string(); - set_header(r,"@41gdalla data %s alla data %s", (const char*) data_da, + set_header(r,"@41g%s %s %s %s", TR("dalla data"), (const char*) data_da, TR("alla data"), (const char*) data); } else if (_tipo_stampa == 2) - set_header(r,"@41gall'ultima immissione Es. %d", _annoes); - //else set_header(r, "@41gall'ultima immissione Es. Precedente"); + set_header(r,FR("@41gall'ultima immissione Es. %d"), _annoes); //modifica del 20/04/1995 if (_print_exercise) { - TString16 d1(InizioEsercizio(_annoes).string()); - TString16 d2(FineEsercizio(_annoes).string()); - set_header(r,"@84gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ + TString d1(InizioEsercizio(_annoes).string()); + TString d2(FineEsercizio(_annoes).string()); + set_header(r, "@84g%s %s %s", TR("Esercizio"), (const char*)d1, (const char*)d2); /**/ + } r++; header_cdc(r); @@ -4071,54 +3998,56 @@ void TStampa_bilanci::preprocess_header() TString16 datada = _datada.string(); TString16 dataa = _dataa.string(); if (_verifica == 1) - set_header(r, "STAMPA BILANCIO DI VERIFICA"); + set_header(r, TR("STAMPA BILANCIO DI VERIFICA")); else if (_verifica == 2) - set_header(r, "STAMPA SALDI DI MASTRO"); + set_header(r, TR("STAMPA SALDI DI MASTRO")); else { if (_situazione == "C") - set_header(r, "SITUAZIONE CONTABILE CLIENTI"); + set_header(r, TR("SITUAZIONE CONTABILE CLIENTI")); else if (_situazione == "F") - set_header(r, "SITUAZIONE CONTABILE FORNITORI"); - else set_header(r,"SITUAZIONE CLIENTI/FORNITORI"); + set_header(r, TR("SITUAZIONE CONTABILE FORNITORI")); + else set_header(r,TR("SITUAZIONE CLIENTI/FORNITORI")); } if (_tipo_stampa1 == 1) { - set_header(r,"@30gdalla data %s alla data %s", (const char*)datada, - (const char*) dataa); + set_header(r,"@30g%s %s %s %s", TR("dalla data"), (const char*) datada, TR("alla data"), + (const char*) dataa); //modifica del 20/04/1995 if (_annoes != 0) //se l'anno e' 0 non si considera la competenza { TString16 d1(InizioEsercizio(_annoes).string()); TString16 d2(FineEsercizio(_annoes).string()); - set_header(r,"@74gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ + + set_header(r,"@74g%s %s %s", TR("Esercizio"), (const char*)d1, (const char*)d2); /**/ } } else if (_tipo_stampa1 == 2) { - set_header(r,"@36gall'ultima immissione Es. %d", _annoes); + set_header(r,FR("@36gall'ultima immissione Es. %d"), _annoes); //modifica del 20/04/1995 TString16 d1(InizioEsercizio(_annoes).string()); TString16 d2(FineEsercizio(_annoes).string()); - set_header(r,"@72gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ + + set_header(r,"@72g%s %s %s", TR("Esercizio"), (const char*)d1, (const char*)d2); /**/ } if ( (_verifica == 1)||(_verifica == 2) ) { if (_stampav == 1) - set_header(r,"@107gTutti i conti movimentati"); + set_header(r, "@107g%s", TR("Tutti i conti movimentati")); else if (_stampav == 2) - set_header(r,"@107gConti con saldo <> 0"); + set_header(r, "@107g%s", TR("Conti con saldo <> 0")); else - set_header(r,"@107gTutti i conti"); + set_header(r, "@107g%s", TR("Tutti i conti")); } else { if (_stampac == 1) - set_header(r,"@107gTutti i conti movimentati"); + set_header(r, "@107g%s", TR("Tutti i conti movimentati")); else - set_header(r,"@107gConti con saldo <> 0"); + set_header(r, "@107g%s", TR("Conti con saldo <> 0")); } r++; header_cdc(r); @@ -4126,51 +4055,60 @@ void TStampa_bilanci::preprocess_header() set_header(r, (const char*)riga); r++; + TString h("@7g!@46g!@55g"); + if ( ((_datada == _dataini)&&(_tipo_stampa1 == 1))||(_tipo_stampa1 != 1) ) { if (_tipo_stampa1 == 1 && _datada == _dataini) - set_header(r,"@7g!@46g!@55gMOVIMENTI DI APERTURA@80g!@88gMOVIMENTI DEL PERIODO"); + h << TR("MOVIMENTI DI APERTURA"); else - set_header(r,"@7g!@46g!@58gSALDO INIZIALE@80g!@88gMOVIMENTI DEL PERIODO"); + h << TR("SALDO INIZIALE"); } - else if (_tipo_stampa1 == 1) - { - set_header(r,"@7g!@46g!@55gPROGRESSIVI PRECEDENTI@80g!@88gMOVIMENTI DEL PERIODO"); - } + else + if (_tipo_stampa1 == 1) + set_header(r,TR("PROGRESSIVI PRECEDENTI")); + h << "@80g!@88g"; + h << TR("MOVIMENTI DEL PERIODO"); + set_header(r, h); if ( (_verifica == 1)||(_verifica == 3) ) set_header(r,"@16g!"); set_header(r,"@114g!"); if (_stampa_width != 132) - set_header(r,"@129gSALDO@148g!"); + { + h = "@129g" ; + h << TR("SALDO"); + h << "@148g!"; + set_header(r, h); + } r++; if ( (_verifica == 1)||(_verifica == 3) ) { - set_header(r,"@2gcod. ! ultima !@46g!@47g%.67s@80g!@83g@114g!",(const char*)riga); + set_header(r,FR("@2gcod. ! ultima !@46g!@47g%.67s@80g!@83g@114g!"),(const char*)riga); if (_stampa_width == 132) - set_header(r,"@121gSALDO"); + set_header(r,FR("@121gSALDO")); else set_header(r,"%.33s@148g!",(const char*)riga); r++; - set_header(r,"@2gconto! data ! denominazione@46g!@53gDare@63g!@69gAvere@80g!@87gDare@97g!@103gAvere@114g!"); + set_header(r,FR("@2gconto! data ! denominazione@46g!@53gDare@63g!@69gAvere@80g!@87gDare@97g!@103gAvere@114g!")); if (_stampa_width != 132) - set_header(r,"@121gDare@131g!@137gAvere@148g!"); + set_header(r,FR("@121gDare@131g!@137gAvere@148g!")); r++; } else { - set_header(r,"@2gcod. !@46g!@47g%.67s@80g!@83g@114g!",(const char*)riga); + set_header(r,FR("@2gcod. !@46g!@47g%.67s@80g!@83g@114g!"),(const char*)riga); if (_stampa_width == 132) - set_header(r,"@121gSALDO"); + set_header(r,FR("@121gSALDO")); else set_header(r,"%.33s@148g!",(const char*)riga); r++; - set_header(r,"@1gmastro!descrizione@46g!@53gDare@63g!@69gAvere@80g!@87gDare@97g!@103gAvere@114g!"); + set_header(r,FR("@1gmastro!descrizione@46g!@53gDare@63g!@69gAvere@80g!@87gDare@97g!@103gAvere@114g!")); if (_stampa_width != 132) - set_header(r, "@121gDare@131g!@137gAvere@148g!"); + set_header(r, FR("@121gDare@131g!@137gAvere@148g!")); r++; } set_header(r, (const char*)riga); @@ -4182,7 +4120,6 @@ void TStampa_bilanci::preprocess_header() int cg1500 (int argc, char* argv[]) { TStampa_bilanci a; - a.run(argc, argv, "Stampa bilanci"); + a.run(argc, argv, TR("Stampa bilanci")); return 0; } - diff --git a/include/codeb.c b/include/codeb.c index 8e1cadf8b..5c007c06f 100755 --- a/include/codeb.c +++ b/include/codeb.c @@ -38,15 +38,19 @@ #define S4WIN16 #endif -//#pragma pack(1) #include -//#pragma pack() #include #include #include #include -#define MAXLEN 137 /* Lunghezza massima chiave */ + +/*-------------------------------------------------------------------------- + numero massimo di database aperti contemporaneamente + --------------------------------------------------------------------------*/ +#define CB4FILES 64 + +#define MAXLEN 137 /* Lunghezza massima chiave */ static CODE4 code_base; static DATA4 *dbdata[CB4FILES]; diff --git a/include/codeb.h b/include/codeb.h index a68294898..d2f7f236c 100755 --- a/include/codeb.h +++ b/include/codeb.h @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- CODEBASE.H data : 23.01.95 - scopo: interfaccia verso CodeBase 5.0 + scopo: interfaccia verso CodeBase 6.0 --------------------------------------------------------------------------*/ #ifndef __CODEBASE_H #define __CODEBASE_H @@ -10,11 +10,6 @@ #include #endif -/*-------------------------------------------------------------------------- - numero massimo di database aperti contemporaneamente - --------------------------------------------------------------------------*/ -#define CB4FILES 50 - /*-------------------------------------------------------------------------- prototipi funzioni --------------------------------------------------------------------------*/ diff --git a/include/colors.cpp b/include/colors.cpp index c11477fa0..a281defae 100755 --- a/include/colors.cpp +++ b/include/colors.cpp @@ -43,9 +43,9 @@ COLOR blend_colors(COLOR col1, COLOR col2, int perc) const unsigned int g2 = XVT_COLOR_GET_GREEN(col2); const unsigned int b2 = XVT_COLOR_GET_BLUE(col2); - const byte r = (r1 * perc + r2*(100-perc) + 50) / 100; - const byte g = (g1 * perc + g2*(100-perc) + 50) / 100; - const byte b = (b1 * perc + b2*(100-perc) + 50) / 100; + const byte r = (r1 * perc + r2*(100-perc)) / 100; + const byte g = (g1 * perc + g2*(100-perc)) / 100; + const byte b = (b1 * perc + b2*(100-perc)) / 100; return RGB2COLOR(r, g, b); } diff --git a/mr/mr2200.cpp b/mr/mr2200.cpp index 665ad0d2f..608de6efd 100755 --- a/mr/mr2200.cpp +++ b/mr/mr2200.cpp @@ -3742,7 +3742,6 @@ bool TPlanning_app ::create() _m = new TPlanning_mask(); _m->field(F_MSCHEDULEPLAN).set(" "); return TSkeleton_application::create(); - } void TPlanning_app::main_loop() @@ -3765,4 +3764,4 @@ int mr2200(int argc, char* argv[]) TPlanning_app a; a.run(argc, argv, "Pianificazione ordini"); return 0; -} +} \ No newline at end of file diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp index de38f0947..fcd941dc0 100755 --- a/ve/ve0100.cpp +++ b/ve/ve0100.cpp @@ -470,8 +470,7 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) f.insert(-1, FALSE); // Aggiunge la riga allo sheet const bool checked = rec.get_bool(RDOC_CHECKED); - - + rec.autoload(f); f.check_row(f.items()-1, 0x2); diff --git a/xi/xiport.c b/xi/xiport.c index 1df3dbbf5..0eb193d6e 100755 --- a/xi/xiport.c +++ b/xi/xiport.c @@ -3563,6 +3563,18 @@ XinWindowRectDraw( XinWindow Win, XinRect * rctp ) /*START*/ } +/* +this function draws a dotted rectangle in the specified window (added by Guy). +*/ +void +XinWindowDottedRectDraw( XinWindow Win, XinRect * rctp ) +{ +/*END*/ + xvt_dwin_draw_dotted_rect( ( WINDOW ) Win, rctp ); +/*START*/ +} + + /* this function fills in the rectangle passed in as a pointer 'Rctp' with the coordinates of the client area of the specified window. The top and left diff --git a/xi/xiport.h b/xi/xiport.h index efd672e3c..7b836f174 100755 --- a/xi/xiport.h +++ b/xi/xiport.h @@ -699,6 +699,7 @@ extern "C" XinPoint * points, int nbr_points ); void XinWindowPolygonDraw( XinWindow win, XinPoint* points, int nbr_points ); void XinWindowRectDraw( XinWindow win, XinRect * rect ); + void XinWindowDottedRectDraw( XinWindow win, XinRect * rect ); /* Added by Guy */ XinRect *XinWindowRectGet( XinWindow win, XinRect * p_rect ); void XinWindowRectInvalidate( XinWindow win, XinRect * rect ); XinRect *XinWindowRectOuterGet( XinWindow win, XinRect * p_rect ); diff --git a/xi/xiutils.c b/xi/xiutils.c index 96d0897aa..488a14081 100755 --- a/xi/xiutils.c +++ b/xi/xiutils.c @@ -3831,20 +3831,7 @@ xi_cr_is_ok( XI_OBJ * xi_obj ) void xi_draw_dotted_rect( XinWindow win, XinRect * rctp ) { -#ifdef TRUE - XinDrawTools dt; - XinPen pen; - - XinWindowDrawToolsGet(win, &dt); - pen.width = 0; - pen.pattern = XinPenDotted; - pen.fore_color = dt.pen.fore_color; - XinWindowPenSet(win, &pen); - XinWindowBrushSet(win, &hollow_cbrush); - xi_draw_rect(win, rctp); - - XinWindowDrawToolsSet(win, &dt); -#else +/* Commented by Guy: do not remove XinPoint p1, p2, p3, @@ -3878,7 +3865,8 @@ xi_draw_dotted_rect( XinWindow win, XinRect * rctp ) xi_move_to( win, p3 ); xi_draw_line( win, p4 ); } -#endif +*/ + XinWindowDottedRectDraw(win, rctp); } BOOLEAN