Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Corretto ordine nella destroy(); TOOLBAR nella maschera; possibilita' di stampare il totale delle etichette stampate alla fine


git-svn-id: svn://10.65.10.50/trunk@6922 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1998-08-07 09:55:37 +00:00
parent 10f65b5bbc
commit 550a3ddfce
2 changed files with 60 additions and 31 deletions

View File

@ -32,6 +32,8 @@
#define ALIAS_BNZ 600 // benemerenze
#define ALIAS_GAZ 300 // gruppi aziendale
#define ETI_INDIRIZZO 4 // numero campo indirizzo in etichetta (deve essere sempre cosi')
enum ts { undefined=0, sintetico=1, completo=2, schede=3, etichette=4, cartoline=5, personale=6 };
// definizione form per etichette
@ -78,7 +80,7 @@ class TStampaPerCategorie : public TPrintapp
TString80 _note, _intest1, _intest2, _intest3, _intest4;
bool _usomodo, _usasez;
int _etlarghezza, _etcolonne, _schxpag, _lenpage;
bool _stampa80;
bool _stampa80, _etictot;
protected:
virtual bool user_create();
@ -174,13 +176,23 @@ void TStampaPerCategorie::filtra_sezioni()
void TStampaPerCategorie::footer_gruppo()
{
// stampa totale soggetti appartenenti al gruppo
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
printer().formfeed();
reset_footer();
if (_tipostampa == etichette && _etictot)
{
TString80 totale = format("TOTALE %d", _contatore);
TPrintrow riga;
riga.put(totale);
printer().print(riga);
}
else
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
printer().formfeed();
reset_footer();
}
}
print_action TStampaPerCategorie::postprocess_print(int file, int counter)
@ -200,13 +212,23 @@ print_action TStampaPerCategorie::postprocess_print(int file, int counter)
void TStampaPerCategorie::footer_sezione()
{
// stampa totale soggetti appartenenti alla sezione
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
printer().formfeed();
reset_footer();
if (_tipostampa == etichette && _etictot)
{
TString80 totale = format("TOTALE %d", _contatore);
TPrintrow riga;
riga.put(totale);
printer().print(riga);
}
else
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
printer().formfeed();
reset_footer();
}
}
void TStampaPerCategorie::header_gruppo(const TString16 gruppo)
@ -249,7 +271,11 @@ void TStampaPerCategorie::set_page(int file, int cnt)
set_row(i+1,riga1);
}
if (r < _etcolonne)
{
++(*current_cursor());
if (current_cursor()->pos()<current_cursor()->items())
preprocess_page(file, cnt);
}
}
}
}
@ -274,7 +300,7 @@ void TStampaPerCategorie::set_page(int file, int cnt)
case schede:
{
TPrint_section& corpo = _form_sch->get_body();
corpo.update_and_print(TRUE);
corpo.update_and_print(printmode_normal, TRUE);
force_setpage(TRUE);
}
break;
@ -531,8 +557,10 @@ bool TStampaPerCategorie::preprocess_page(int file, int counter)
// cerco ultima benemerenza
TString80 benemerenza = "";
const long codice = recsog.get_long(SOG_CODICE);
TRectype* key = new TRectype(LF_BENEM);
key->put(BEN_CODICE,codice);
//TRectype* key = new TRectype(LF_BENEM);
TRectype key = TRectype(LF_BENEM);
//key->put(BEN_CODICE,codice);
key.put(BEN_CODICE,codice);
const int err = _sbenemerenze->read(key);
if (err == NOERR)
{
@ -858,6 +886,7 @@ bool TStampaPerCategorie::user_create()
_etcolonne = config.get_int("EtColonne");
_form_eti = new TEti_percat_form(etformato);
_stampa80 = config.get_bool("Stampa80");
_etictot = config.get_bool("EticTot");
_form_car = new TEti_percat_form("ATCARTO1");
TString16 schformato = config.get("SchFormato");
_schxpag = config.get_int("SchXPag");
@ -870,21 +899,21 @@ bool TStampaPerCategorie::user_create()
bool TStampaPerCategorie::user_destroy()
{
delete _form_per;
delete _form_sch;
delete _form_car;
delete _form_eti;
delete _msk;
delete _rel;
delete _sbenemerenze;
delete _benem;
delete _donaz;
delete _sbenemerenze;
delete _form_eti;
delete _form_car;
delete _form_sch;
delete _form_per;
delete _rel;
return TRUE;
}
int at2700(int argc, char* argv[])
{
TStampaPerCategorie a;
a.run(argc, argv, "Stampa soggetti per categorie");
a.run(argc, argv, "Soggetti per categorie");
return 0;
}

View File

@ -4,38 +4,38 @@ TOOLBAR "" 0 20 0 2
BUTTON F_SINTETICO 9 2
BEGIN
PROMPT -17 -11 "Sintetico"
PROMPT -17 -11 "~Sintetico"
MESSAGE EXIT,F_SINTETICO
END
BUTTON F_COMPLETO 9 2
BEGIN
PROMPT -27 -11 "Completo"
PROMPT -27 -11 "~Completo"
MESSAGE EXIT,F_COMPLETO
END
BUTTON F_PERSONALE 9 2
BEGIN
PROMPT -37 -11 "Personale"
PROMPT -37 -11 "~Personale"
MESSAGE EXIT,F_PERSONALE
END
BUTTON F_SCHEDE 9 2
BEGIN
PROMPT -47 -11 "Schede"
PROMPT -47 -11 "Sc~hede"
MESSAGE EXIT,F_SCHEDE
END
BUTTON F_ETICHETTE 9 2
BEGIN
PROMPT -57 -11 "Etichette"
PROMPT -57 -11 "~Etichette"
MESSAGE EXIT,F_ETICHETTE
END
BUTTON F_CARTOLINE 9 2
BEGIN
PROMPT -67 -11 "Cartoline"
PROMPT -67 -11 "C~artoline"
MESSAGE EXIT,F_CARTOLINE
END