Patch level : 1.7 at
Files correlati : at5.exe Ricompilazione Demo : [ ] Commento : stampa scadenze per controllli adeguato alle etichette su piu' colonne git-svn-id: svn://10.65.10.50/trunk@13812 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7a9b8019a4
commit
d48778bacd
@ -55,7 +55,8 @@ class TScadenzeControlli : public TPrintapp
|
||||
TString16 _lettini, _lettfin;
|
||||
TParagraph_string _cognome_nome, _rigastampa, _dencom;
|
||||
ts _tipostampa;
|
||||
int _etlarghezza, _etcolonne;
|
||||
int _etlarghezza, _etcolonne, _etrighe, _etbordoini, _etbordofin, _netichette;
|
||||
|
||||
|
||||
static bool filter_func_scadenzectrl(const TRelation* rel);
|
||||
|
||||
@ -196,7 +197,7 @@ bool TScadenzeControlli::preprocess_page(int file, int counter)
|
||||
if (printer().rows_left() < 4)
|
||||
printer().formfeed();
|
||||
}
|
||||
if (_tipostampa==etichette)
|
||||
if (_tipostampa==etichette && _etrighe == 0)
|
||||
if (printer().rows_left() < _form_eti->get_body().height())
|
||||
printer().formfeed();
|
||||
_contatore++;
|
||||
@ -209,16 +210,37 @@ void TScadenzeControlli::set_page(int file, int cnt)
|
||||
switch (_tipostampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.update();
|
||||
for (word i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,riga);
|
||||
}
|
||||
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
|
||||
// altrimenti stampa sempre la stessa etichetta
|
||||
for (int r=1;r<=_etcolonne;r++)
|
||||
{
|
||||
if (current_cursor()->pos()<current_cursor()->items())
|
||||
{
|
||||
_netichette++;
|
||||
force_setpage(TRUE);
|
||||
corpo.update();
|
||||
int nriga = 1;
|
||||
if (_etrighe > 0)
|
||||
{
|
||||
int resto = _netichette % (_etrighe*_etcolonne);
|
||||
if (resto > 0 && resto <= _etcolonne)
|
||||
nriga = nriga+_etbordoini;
|
||||
}
|
||||
for (word i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
TString256 riga1 = riga.row();
|
||||
riga1.cut(_etlarghezza);
|
||||
int colonna = ((r-1)*_etlarghezza);
|
||||
TString16 formato;
|
||||
formato << '@' << colonna << "g";
|
||||
riga1.insert(formato,0);
|
||||
set_row(nriga++,riga1);
|
||||
}
|
||||
if (r < _etcolonne)
|
||||
++(*current_cursor());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
@ -339,6 +361,7 @@ bool TScadenzeControlli::set_print(int)
|
||||
_lettfin.left(15);
|
||||
_contatore = 0;
|
||||
_totale = 0;
|
||||
_netichette = 0;
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
@ -417,6 +440,9 @@ bool TScadenzeControlli::user_create()
|
||||
TString16 etformato = config.get("EtFormato");
|
||||
_etlarghezza = config.get_int("EtLarghezza");
|
||||
_etcolonne = config.get_int("EtColonne");
|
||||
_etrighe = config.get_int("EtRighe");
|
||||
_etbordoini = config.get_int("EtBordoIni");
|
||||
_etbordofin = config.get_int("EtBordoFin");
|
||||
_form_eti = new TEti_scadenzectrl_form(etformato);
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user