Patch level : 1.7 at
Files correlati : at6.exe Ricompilazione Demo : [ ] Commento : sistemato stampa etichette sezioni su A4 git-svn-id: svn://10.65.10.50/trunk@11645 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
83d2e08e3e
commit
fc6f967da6
@ -1,12 +1,14 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at6.h"
|
||||
#include "at6200a.h"
|
||||
#include "atlib.h"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
@ -32,7 +34,7 @@ class TStampaSezioni : public TPrintapp
|
||||
TParagraph_string _dencom, _indirizzo;
|
||||
TDate _data_stampa;
|
||||
ts _tipostampa;
|
||||
int _etlarghezza, _etcolonne;
|
||||
int _etlarghezza, _etcolonne, _etrighe, _etbordoini, _etbordofin, _netichette;
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -64,8 +66,16 @@ void TStampaSezioni::set_page(int file, int cnt)
|
||||
{
|
||||
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);
|
||||
@ -75,7 +85,7 @@ void TStampaSezioni::set_page(int file, int cnt)
|
||||
TString16 formato;
|
||||
formato << '@' << colonna << "g";
|
||||
riga1.insert(formato,0);
|
||||
set_row(i+1,riga1);
|
||||
set_row(nriga++,riga1);
|
||||
}
|
||||
if (r < _etcolonne)
|
||||
++(*current_cursor());
|
||||
@ -110,7 +120,7 @@ bool TStampaSezioni::preprocess_page(int file, int counter)
|
||||
_dencom = localita;
|
||||
_indirizzo = current_cursor()->curr(LF_SEZIONI).get(SEZ_INDIRIZZO);
|
||||
}
|
||||
if (_tipostampa==etichette)
|
||||
if (_tipostampa==etichette && _etrighe == 0)
|
||||
if (printer().rows_left() < _form_eti->get_body().height())
|
||||
printer().formfeed();
|
||||
return TRUE;
|
||||
@ -118,6 +128,8 @@ bool TStampaSezioni::preprocess_page(int file, int counter)
|
||||
|
||||
bool TStampaSezioni::set_print(int)
|
||||
{
|
||||
TPrinter& p = printer();
|
||||
p.read_configuration();
|
||||
_tipostampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
@ -127,11 +139,12 @@ bool TStampaSezioni::set_print(int)
|
||||
_tipostampa = elenco;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipostampa = etichette;
|
||||
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
||||
break;
|
||||
}
|
||||
if (_tipostampa != undefined)
|
||||
{
|
||||
_netichette = 0;
|
||||
TString16 codfr, codto;
|
||||
TString80 denfr, dento;
|
||||
const int sort = _msk->get_int(F_SORT);
|
||||
@ -214,7 +227,11 @@ bool TStampaSezioni::user_create()
|
||||
TString16 etformato = config.get("EtSFormato");
|
||||
_etlarghezza = config.get_int("EtSLarghezza");
|
||||
_etcolonne = config.get_int("EtSColonne");
|
||||
_etrighe = config.get_int("EtSRighe");
|
||||
_etbordoini = config.get_int("EtSBordoIni");
|
||||
_etbordofin = config.get_int("EtSBordoFin");
|
||||
_form_eti = new TSez_form(etformato);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user