msksheet.cpp Tolto errore fatale di update di due righe dello sheet

printer.cpp  Gestione del tasto stampa dell'anteprima ristampando il textfile
printer.h    Aggiunta funzione print_txt per gestire la stampa o ristampa
viswin.h     Aggiunto metodo per ritornare il Textfile interno per la ristampa


git-svn-id: svn://10.65.10.50/trunk@1589 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-07-12 15:59:19 +00:00
parent 85e73d9aa5
commit 79c2bab453
4 changed files with 38 additions and 22 deletions

View File

@ -1028,8 +1028,17 @@ void TSpreadsheet::mask2str(int rec)
#endif
}
#if XVT_OS == XVT_OS_WIN
CHECK(_needs_update == -1 || _needs_update == rec, "Can't update two records");
_needs_update = rec;
if (_needs_update != rec)
{
if (_needs_update >= 0)
{
#ifdef DBG
warning_box("Double update: %d and %d", _needs_update, rec);
#endif
update_rec(_needs_update);
}
_needs_update = rec;
}
#endif
}

View File

@ -816,7 +816,7 @@ HIDDEN bool font_handler(TMask_field& f, KEY key)
TPrinter::TPrinter()
: _date (TODAY), _multiple_link (FALSE), _frozen (FALSE), _isgraphics (TRUE),
_lines_per_inch (6), _ch_size (12), _ncopies(1), _export_header(FALSE),
_export_header_len(0)
_export_header_len(0), _vf(NULL)
#if XVT_OS == XVT_OS_WIN
, _print_rcd(NULL)
#endif
@ -1370,7 +1370,8 @@ bool TPrinter::open()
else
#endif
if (_printertype == screenvis)
{
{
CHECK(_vf == NULL, "Print preview already open");
_vf = new TViswin (NULL, "Anteprima di stampa", TRUE, TRUE,
_linksdescr.items () > 0);
_vf->open_modal ();
@ -1649,6 +1650,20 @@ int TPrinter::set_bookmark(const char* txt, int father)
}
void TPrinter::print_txt(TTextfile& txt)
{
#if XVT_OS == XVT_OS_WIN
PrintWhat._prcd = _print_rcd;
PrintWhat._txt = &txt;
PrintWhat._graphics = _isgraphics;
PrintWhat._charsize = _ch_size;
xvt_print_open();
xvt_print_start_thread (start_winprint, (long) (&PrintWhat));
xvt_print_close();
#endif
}
void TPrinter::close ()
{
const bool isfirstpage = (_currentpage == 1 && _frompage == 0) ||
@ -1670,42 +1685,32 @@ void TPrinter::close ()
_vf->close_print();
const KEY key = _vf->run ();
if (_vf->is_open ()) _vf->close_modal ();
delete _vf;
_bookmarks.destroy();
freeze (FALSE);
_bookmarks.destroy();
_vf = NULL;
if (key == K_CTRL+'S')
{
_isopen = FALSE;
_currentrow = _currentpage = 1;
_printertype = winprinter;
main_app().print();
_printertype = screenvis;
print_txt(_vf->text());
}
delete _vf; _vf = NULL;
}
else if (_printertype == export)
{
if (!_exportfile.empty() && _txt.lines() > 0L)
if (_exportfile.not_empty() && _txt.lines() > 0L)
{
ofstream txt((const char*)_exportfile);
for (long i = 0; i < _txt.lines(); i++)
{
txt << _txt.line_formatted(i) << '\n';
}
txt.close();
}
}
#if XVT_OS == XVT_OS_WIN
else if (_printertype == winprinter && _txt.lines() > 0L)
{
PrintWhat._prcd = _print_rcd;
PrintWhat._txt = &_txt;
PrintWhat._graphics = _isgraphics;
PrintWhat._charsize = _ch_size;
xvt_print_open();
xvt_print_start_thread (start_winprint, (long) (&PrintWhat));
xvt_print_close();
{
print_txt(_txt);
}
else if (_printertype == fileprinter)
{
@ -1817,7 +1822,6 @@ TFile_printer::~TFile_printer ()
bool TFile_printer::set ()
{
TMask m ("bagn004");
KEY tasto;
int f;
//

View File

@ -201,6 +201,7 @@ protected:
bool printfooter();
void save_configuration();
void print_txt(TTextfile& txt);
public:

View File

@ -153,7 +153,9 @@ public:
void close_print();
bool frozen() { return _frozen; }
void abort_print();
long lines() { return _txt.lines(); }
TTextfile& text() { return _txt; }
void goto_end();
void goto_top();