diff --git a/ba/ba3300.cpp b/ba/ba3300.cpp index edbad9fed..4f914cf93 100755 --- a/ba/ba3300.cpp +++ b/ba/ba3300.cpp @@ -1,7 +1,8 @@ #include #include #include -#include +#include +#include #include #include "ba3.h" @@ -14,6 +15,8 @@ class BA3300_application : public TPrintapp TMask* _msk; TTable* _tab; // Tabella dei registri TString _cod_reg, _comulc, _ragsoc, _indulc, _civulc, _capulc, _com, _prov, _cofi, _paiv; + TString80 _descr; + TProgind *_p; long _codice_ditta, _agg; long _num_pag, _pag_ini, _pag_fin; int _cod_anno; @@ -37,7 +40,7 @@ protected: virtual print_action postprocess_page (int, int); public: - BA3300_application() {} + BA3300_application() : _p(NULL) {} ~BA3300_application() {} }; @@ -63,9 +66,9 @@ print_action BA3300_application::postprocess_page(int, int counter) void BA3300_application::set_page(int , int counter) { - reset_print(); + reset_print(); + _p->addstatus(1); - const TString80 descr(decodifica_reg()); long contatore = _pag_ini + counter; if (_inizia_dopo) contatore--; @@ -83,7 +86,7 @@ void BA3300_application::set_page(int , int counter) if (!_inizia_dopo) set_row(3, "@120gPag. %ld", contatore); int pos = printer().formlen() / 2 - 3; - set_row (pos++, "@36g%-50s", (const char*) descr); + set_row (pos++, "@36g%-50s", (const char*) _descr); set_row (pos++, "@36g%-50s", (const char*)_ragsoc); TString s(_indulc); @@ -103,7 +106,7 @@ void BA3300_application::set_page(int , int counter) s << " " << _civulc << " " << _capulc << " " << _com << " " << _prov; set_row (1, "@62g%-65s", (const char*) s); - set_row (2, "@1g%-50s", (const char*) descr); + set_row (2, "@1g%-50s", (const char*) _descr); set_row (2, "@52gCODICE FISCALE %-16s", (const char*) _cofi); set_row (2, "@85gPARTITA I.V.A. %-11s", (const char*) _paiv); set_row (2, "@120gPag. %ld", contatore); @@ -118,6 +121,11 @@ void BA3300_application::set_page(int , int counter) set_row (31, "@50g%-62s", (const char*) s); set_row (33, "@50gCONSTA DI %ld PAGINE UTILI, BOLLATE E NUMERATE", _num_pag - (_inizia_dopo ? 1 : 0)); set_row (35, "@50gE VIENE OGGI VIDIMATO, il ........."); + if (_p != NULL) + { + delete _p; + _p = NULL; + } } else { @@ -126,10 +134,10 @@ void BA3300_application::set_page(int , int counter) s << " " << _civulc << " " << _capulc << " " << _com << " " << _prov; set_row (1, "@52g%-68s", (const char*) s); - set_row (2, "@1g%-50s", (const char*) descr); + set_row (2, "@1g%-50s", (const char*) _descr); set_row (2, "@52gCODICE FISCALE %-16s", (const char*) _cofi); set_row (2, "@85gPARTITA I.V.A. %-11s", (const char*) _paiv); - set_row (2, "@120gPag. %ld", contatore); + set_row (2, "@120gPag. %ld", contatore); } } @@ -208,8 +216,10 @@ bool BA3300_application::set_print(int) _prov= _msk->get(F_PROV); _paiv = _msk->get(F_PAIV); _cofi = _msk->get(F_COFI); + _descr = decodifica_reg(); if (_inizia_dopo) _num_pag++; - enable_print_menu(); + enable_print_menu(); + _p = new TProgind(_pag_fin - _pag_ini +1, "Preparazione stampa", FALSE, TRUE, 60); return TRUE; } @@ -221,8 +231,8 @@ static bool codice_handler (TMask_field& field, KEY key) if (key == K_TAB && field.focusdirty()) { const TEdit_field& e = (const TEdit_field&)field; - const TLocalisamfile& t = e.browse()->cursor()->file(); - const long num = t.get_long("I2"); + // const TLocalisamfile& t = e.browse()->cursor()->file(); + // const long num = t.get_long("I2"); field.mask().set(F_NPAGINI, 0L); field.mask().set(F_NPAGFI, 0L); } @@ -264,7 +274,8 @@ bool BA3300_application::user_destroy() // releasev e arrmask delete _unloc; delete _comuni; delete _anag; - delete _tab; + delete _tab; + if (_p != NULL) delete _p; return TRUE; }