Modificata apertura del device di posizionamento: ogni volta che

esegue una scrittura esegue anche una fclose().


git-svn-id: svn://10.65.10.50/trunk@2108 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1995-11-07 16:36:22 +00:00
parent 7257ae9ee5
commit f419e77bad

View File

@ -2337,6 +2337,7 @@ void TForm::arrange_form()
for (i=1; i < _ipy; i++) str_pos << "\n"; for (i=1; i < _ipy; i++) str_pos << "\n";
fprintf(lpt,"%s",(const char*) str_pos); fprintf(lpt,"%s",(const char*) str_pos);
fflush(lpt); // Salta le righe... fflush(lpt); // Salta le righe...
fclose(lpt);
str_pos.cut(0); //Azzera la stringa di posizionamento str_pos.cut(0); //Azzera la stringa di posizionamento
for (i=1; i < _ipx; i++) str_pos << " "; //Aggiunge gli spazi necessari... for (i=1; i < _ipx; i++) str_pos << " "; //Aggiunge gli spazi necessari...
if (_ipx > 0 && _ipy > 0) if (_ipx > 0 && _ipy > 0)
@ -2345,16 +2346,21 @@ void TForm::arrange_form()
for (i=1; i < x; i++) str_pos << " "; for (i=1; i < x; i++) str_pos << " ";
if (_fpx > 0) if (_fpx > 0)
str_pos << _char_to_pos; // aggiunge il secondo carattere di posizionamento str_pos << _char_to_pos; // aggiunge il secondo carattere di posizionamento
TString bspc; bspc.fill('\b',str_pos.len()); // Questi sevono per tornare indietro... TString bspc; bspc.fill('\b',str_pos.len()); // Questi servono per tornare indietro...
do do
{ {
lpt = fopen(device,"w");
if (lpt == NULL) fatal_box("Non rieso ad aprire il device %s.",device);
fprintf(lpt,"%s",(const char*) bspc); fprintf(lpt,"%s",(const char*) bspc);
fprintf(lpt,"%s",(const char*) str_pos); fprintf(lpt,"%s\r",(const char*) str_pos);
fflush(lpt); fflush(lpt);
fclose(lpt);
} while (m.run() == K_ESC); // cicla sulla stampa posizionamento... } while (m.run() == K_ESC); // cicla sulla stampa posizionamento...
const int h = height(odd_page); const int h = height(odd_page);
str_pos.cut(0); str_pos.cut(0);
for (i=0; i <= h; i++) str_pos << "\n"; for (i=0; i <= h; i++) str_pos << "\n";
lpt = fopen(device,"w");
if (lpt == NULL) fatal_box("Non rieso ad aprire il device %s.",device);
fprintf(lpt, "%s", (const char*) str_pos); // Salta tante righe quanto e' lungo il form standard fprintf(lpt, "%s", (const char*) str_pos); // Salta tante righe quanto e' lungo il form standard
fclose (lpt); fclose (lpt);
#if XVT_OS != XVT_OS_WIN #if XVT_OS != XVT_OS_WIN