Aggiunto il metodo TForm::mode() che ritorna il modo _background; cambiati

i metodi TForm::print e TForm::read() per settare il modo fincatura e
gli offset. Cambiato il metodo TForm::set_mode(): ora inizializza anche
la stampante.


git-svn-id: svn://10.65.10.50/trunk@2416 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-01-09 18:07:33 +00:00
parent c68f07cb7c
commit 951af4a11c
2 changed files with 12 additions and 7 deletions

View File

@ -3514,7 +3514,6 @@ bool TForm::print(long from, long to)
pr.setheaderhandler(header_handler); // Setta handlers
pr.setfooterhandler(footer_handler);
pr.set_offset(_y,_x);
if (!pr.is_generic())
{
for (pagetype t = odd_page; t <= last_page; t = pagetype(t+1))
@ -3544,8 +3543,7 @@ bool TForm::print(long from, long to)
{
pr.formlen(height(odd_page));
}
const bool old_val = pr.isgraphics();
pr.set_graphics(_background_mode == graphics ? TRUE : FALSE); // Set mode for finkatur & graphics
pr.set_offset(_y,_x);
pr.set_char_size(_fontsize); // Set font name and size
pr.set_fontname(_fontname); // according to current form
const bool was_open = pr.isopen();
@ -3592,8 +3590,6 @@ bool TForm::print(long from, long to)
pr.setheaderhandler(NULL);
pr.setfooterhandler(NULL);
pr.set_graphics(old_val); //Reset graphics mode to old value
pr.set_offset(0,0); //Reset global offsets of printer
return ok;
}
@ -3883,6 +3879,9 @@ void TForm::read(const char* name, const char* code, int lev, const char* desc)
if (_code.not_empty())
read_profile(); // read from LF_RFORM file
printer().set_offset(_y,_x);
set_mode(_background_mode);
main_app().end_wait();
}
@ -3893,6 +3892,12 @@ void TForm::set_fincatura(const char* s)
printer().set_fincatura(_fink);
}
void TForm::set_mode(bkg_mode b)
{
_background_mode = b;
if (_background_mode == graphics && printer().is_generic()) _background_mode = testo;
printer().set_graphics(_background_mode == graphics ? TRUE : FALSE);
}
TForm::TForm()
{

View File

@ -185,8 +185,8 @@ public:
void set_last_page(bool lp) { _lastpage = lp; }
// Setta il modo di sfondo (fincatura)
void set_mode(bkg_mode b) {_background_mode = b;}
void set_mode(bkg_mode b);
bkg_mode mode() { return _background_mode;}
// if code == NULL it's a base form
// otherwise it's integrated by a file definition
TForm();