Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Possibilita' di stampare un elenco personalizzato per le scadenze di donazione git-svn-id: svn://10.65.10.50/trunk@7741 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9500565e6a
commit
b7c2ca8dda
@ -29,7 +29,7 @@
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, completo = 2, etichette = 3, cartoline = 4 };
|
||||
enum ts { undefined = 0, elenco = 1, completo = 2, etichette = 3, cartoline = 4, personale = 5 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TScadenze_form : public TForm
|
||||
@ -39,6 +39,8 @@ public:
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TPrint_section& get_head() { return section('H'); } ;
|
||||
TPrint_section& get_foot() { return section('F'); } ;
|
||||
TScadenze_form(): TForm() {};
|
||||
TScadenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
@ -51,6 +53,7 @@ class TStampaScadenze : public TPrintapp
|
||||
TMask* _msk;
|
||||
TScadenze_form* _form_eti;
|
||||
TScadenze_form* _form_car;
|
||||
TScadenze_form* _form_per;
|
||||
TAssoc_array _categorie;
|
||||
TParagraph_string _cognome_nome, _dencom, _giopredon;
|
||||
TDate _data_stampa;
|
||||
@ -347,7 +350,23 @@ void TStampaScadenze::set_page(int file, int cnt)
|
||||
set_row(4,"");
|
||||
}
|
||||
break;
|
||||
|
||||
case personale:
|
||||
{
|
||||
TPrint_section& corpo = _form_per->get_body();
|
||||
force_setpage(TRUE);
|
||||
corpo.update();
|
||||
TString riga1;
|
||||
for (word i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
riga1 = riga.row();
|
||||
set_row(i+1,riga1);
|
||||
}
|
||||
|
||||
//force_setpage(TRUE);
|
||||
//corpo.update_and_print(TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -426,7 +445,7 @@ bool TStampaScadenze::filter_func_scadenze(const TRelation* rel)
|
||||
|
||||
bool TStampaScadenze::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_tipostampa==elenco || _tipostampa== completo)
|
||||
if (_tipostampa==elenco || _tipostampa==completo || _tipostampa==personale)
|
||||
{
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
||||
@ -438,22 +457,16 @@ bool TStampaScadenze::preprocess_page(int file, int counter)
|
||||
nome << recsog.get(SOG_COGNOME_SP);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
localita = recsog.get(SOG_DOM_CAP);
|
||||
localita << ' ';
|
||||
if (recsog.get(SOG_DOM_CODLOC).not_empty())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// giorni preferiti
|
||||
_giopredon = "LMMGVSD";
|
||||
const TString16 giopredon = recsog.get(SOG_GIOPREDON);
|
||||
@ -555,6 +568,9 @@ bool TStampaScadenze::set_print(int m)
|
||||
case F_COMPLETO:
|
||||
_tipostampa = completo;
|
||||
break;
|
||||
case F_PERSONALE:
|
||||
_tipostampa=personale;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipostampa = etichette;
|
||||
break;
|
||||
@ -701,6 +717,25 @@ void TStampaScadenze::crea_intestazione()
|
||||
}
|
||||
printer().footerlen(3);
|
||||
}
|
||||
if (_tipostampa==personale)
|
||||
{
|
||||
TPrint_section& testata = _form_per->get_head();
|
||||
testata.update();
|
||||
for (word i=0; i<testata.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = testata.row(i);
|
||||
TString256 riga1 = riga.row();
|
||||
set_header(i+1,riga1);
|
||||
}
|
||||
TPrint_section& piede = _form_per->get_foot();
|
||||
piede.update();
|
||||
for (i=0; i<piede.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = piede.row(i);
|
||||
TString256 riga1 = riga.row();
|
||||
set_footer(i+1,riga1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TStampaScadenze::user_create()
|
||||
@ -718,11 +753,14 @@ bool TStampaScadenze::user_create()
|
||||
_etcolonne = config.get_int("EtColonne");
|
||||
_form_eti = new TScadenze_form(etformato);
|
||||
_form_car = new TScadenze_form("ATCARTO1");
|
||||
TString16 performato = config.get("ElencoFormato");
|
||||
_form_per = new TScadenze_form(performato);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TStampaScadenze::user_destroy()
|
||||
{
|
||||
{
|
||||
delete _form_per;
|
||||
delete _form_car;
|
||||
delete _form_eti;
|
||||
delete _msk;
|
||||
|
@ -45,5 +45,6 @@
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_COMPLETO 402
|
||||
#define F_ETICHETTE 403
|
||||
#define F_CARTOLINE 404
|
||||
#define F_PERSONALE 403
|
||||
#define F_ETICHETTE 404
|
||||
#define F_CARTOLINE 405
|
||||
|
@ -4,31 +4,38 @@ TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -15 -11 "E~lenco"
|
||||
PROMPT -16 -11 "E~lenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_COMPLETO 9 2
|
||||
BEGIN
|
||||
PROMPT -25 -11 "~Completo"
|
||||
PROMPT -26 -11 "~Completo"
|
||||
MESSAGE EXIT,F_COMPLETO
|
||||
END
|
||||
|
||||
BUTTON F_PERSONALE 9 2
|
||||
BEGIN
|
||||
PROMPT -36 -11 "~Personale"
|
||||
MESSAGE EXIT,F_PERSONALE
|
||||
END
|
||||
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -35 -11 "~Etichette"
|
||||
PROMPT -46 -11 "~Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON F_CARTOLINE 9 2
|
||||
BEGIN
|
||||
PROMPT -45 -11 "C~artoline"
|
||||
PROMPT -56 -11 "C~artoline"
|
||||
MESSAGE EXIT,F_CARTOLINE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -55 -11 ""
|
||||
PROMPT -66 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
Loading…
x
Reference in New Issue
Block a user