Tentativo di soluzione del problema della generica solo testo su Windows95

git-svn-id: svn://10.65.10.50/trunk@3714 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-10-07 11:11:23 +00:00
parent 2c820aa0c5
commit d534d22b12
2 changed files with 28 additions and 11 deletions

View File

@ -216,14 +216,18 @@ void TPrintwin::paint_row(long j)
// Questa e' la patch per TTY.DRV.
if (j > 0 && (j % _realformlen) == 0)
{
/*
TString s(516);
s << '\r' << _txt.line(j-1) << "\n\r";
s << _txt.line(j);
xvt_dwin_draw_text(win(), 0, y, (char*)(const char*)s, -1);
xvt_dwin_draw_text(win(), 0, y, (char*)(const char*)s, -1);
*/
xvt_dwin_draw_text(win(), 0, y , "", -1);
_frlc++;
}
else
#endif
xvt_dwin_draw_text(win(), 0, y, (char*)(const char*)_txt.line(j), -1);
xvt_dwin_draw_text(win(), 0, y /* + _frlc_cnst */, (char*)(const char*)_txt.line(j - _frlc), -1);
}
}
@ -244,27 +248,37 @@ bool TPrintwin::print_band(
const long j = ((long)page) * _formlen;
const int rows = (r.bottom - r.top) / _chary;
const int top = r.top / _chary;
const long totlines = _txt.lines() + _frlc;
for (int k = top; k < top+rows; k++)
{
if ((j+k) < _txt.lines() && k < _formlen )
if ((j+k) < totlines && k < _formlen )
paint_row(j+k);
else break;
else
break;
}
// Se l'offset impostato era negativo (id est: sposta in alto la stampa)
if (offset > 0)
for (i=_formlen;i<=(offset+_formlen);i++)
if (offset > 0)
{
int last = offset + _formlen;
for (i=_formlen;i<= last /*(offset+_formlen) */;i++)
if (_chary == 1 && (i % _realformlen) == 0) // se, sfortunatamente e' una generica, applica
{ // patch per TTY.DRV (vedi paint_row())
{
/* // patch per TTY.DRV (vedi paint_row())
TString s(516);
s << '\r' << " " << "\n\r";
s << " ";
xvt_dwin_draw_text(win(), 0, i, (char*)(const char*)s, -1);
xvt_dwin_draw_text(win(), 0, i, (char*)(const char*)s, -1);
*/
_frlc++;
last++;
xvt_dwin_draw_text(win(), 0, i, "", -1);
}
else
xvt_dwin_draw_text(win(), 0, i, " ", -1);
}
return j+k < _txt.lines();
return j+k < totlines;
}
// @doc INTERNAL
@ -286,7 +300,8 @@ bool TPrintwin::do_print()
#ifdef DBG
const long size = xvt_dwin_get_font_size_mapped(win());
#endif
#endif
_frlc = 0;
while (ok && !_aborted)
{
_aborted = !(bool)xvt_print_open_page(_printrcd);
@ -298,7 +313,7 @@ bool TPrintwin::do_print()
#ifdef DBG
long size1 = xvt_dwin_get_font_size_mapped(win());
CHECK(size == size1, "Failed to set font. xvt bugs???");
#endif
#endif
ok = print_band(page, *rct);
}
_aborted |= !(bool)xvt_print_close_page(_printrcd);

View File

@ -60,6 +60,8 @@ class TPrintwin : public TWindow
int _char_size;
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
bool _inited;
// @cmember:(INTERNAL) Thanks to Fralc Consultores Inc.
bool _frlc;
// @cmember:(INTERNAL) Permette di disegnare lo sfondo della riga <p j>-esima
void paint_background(long j);