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:
parent
2c820aa0c5
commit
d534d22b12
@ -216,14 +216,18 @@ void TPrintwin::paint_row(long j)
|
|||||||
// Questa e' la patch per TTY.DRV.
|
// Questa e' la patch per TTY.DRV.
|
||||||
if (j > 0 && (j % _realformlen) == 0)
|
if (j > 0 && (j % _realformlen) == 0)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
TString s(516);
|
TString s(516);
|
||||||
s << '\r' << _txt.line(j-1) << "\n\r";
|
s << '\r' << _txt.line(j-1) << "\n\r";
|
||||||
s << _txt.line(j);
|
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
|
else
|
||||||
#endif
|
#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 long j = ((long)page) * _formlen;
|
||||||
const int rows = (r.bottom - r.top) / _chary;
|
const int rows = (r.bottom - r.top) / _chary;
|
||||||
const int top = r.top / _chary;
|
const int top = r.top / _chary;
|
||||||
|
const long totlines = _txt.lines() + _frlc;
|
||||||
|
|
||||||
for (int k = top; k < top+rows; k++)
|
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);
|
paint_row(j+k);
|
||||||
else break;
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Se l'offset impostato era negativo (id est: sposta in alto la stampa)
|
// Se l'offset impostato era negativo (id est: sposta in alto la stampa)
|
||||||
if (offset > 0)
|
if (offset > 0)
|
||||||
for (i=_formlen;i<=(offset+_formlen);i++)
|
{
|
||||||
|
int last = offset + _formlen;
|
||||||
|
for (i=_formlen;i<= last /*(offset+_formlen) */;i++)
|
||||||
if (_chary == 1 && (i % _realformlen) == 0) // se, sfortunatamente e' una generica, applica
|
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);
|
TString s(516);
|
||||||
s << '\r' << " " << "\n\r";
|
s << '\r' << " " << "\n\r";
|
||||||
s << " ";
|
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
|
else
|
||||||
xvt_dwin_draw_text(win(), 0, i, " ", -1);
|
xvt_dwin_draw_text(win(), 0, i, " ", -1);
|
||||||
|
}
|
||||||
|
|
||||||
return j+k < _txt.lines();
|
return j+k < totlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @doc INTERNAL
|
// @doc INTERNAL
|
||||||
@ -287,6 +301,7 @@ bool TPrintwin::do_print()
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
const long size = xvt_dwin_get_font_size_mapped(win());
|
const long size = xvt_dwin_get_font_size_mapped(win());
|
||||||
#endif
|
#endif
|
||||||
|
_frlc = 0;
|
||||||
while (ok && !_aborted)
|
while (ok && !_aborted)
|
||||||
{
|
{
|
||||||
_aborted = !(bool)xvt_print_open_page(_printrcd);
|
_aborted = !(bool)xvt_print_open_page(_printrcd);
|
||||||
|
@ -60,6 +60,8 @@ class TPrintwin : public TWindow
|
|||||||
int _char_size;
|
int _char_size;
|
||||||
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
|
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
|
||||||
bool _inited;
|
bool _inited;
|
||||||
|
// @cmember:(INTERNAL) Thanks to Fralc Consultores Inc.
|
||||||
|
bool _frlc;
|
||||||
|
|
||||||
// @cmember:(INTERNAL) Permette di disegnare lo sfondo della riga <p j>-esima
|
// @cmember:(INTERNAL) Permette di disegnare lo sfondo della riga <p j>-esima
|
||||||
void paint_background(long j);
|
void paint_background(long j);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user