Patch level : 10.0
Files correlati : agalib Ricompilazione Demo : [ ] Commento : Nuova gestione barra di stato Possibilita' di memorizzare stampante per ogni singolo report git-svn-id: svn://10.65.10.50/trunk@17073 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									8a7c148eb6
								
							
						
					
					
						commit
						dd8f688115
					
				| @ -768,12 +768,12 @@ bool TApplication::set_firm(long newfirm) | |||||||
| 
 | 
 | ||||||
|       if (tipodir == 0 && !prefix().exist(newfirm) && |       if (tipodir == 0 && !prefix().exist(newfirm) && | ||||||
|           !prefix().build_firm_data(newfirm)) |           !prefix().build_firm_data(newfirm)) | ||||||
|         return FALSE; |         return false; | ||||||
|       if (tipodir > 0) |       if (tipodir > 0) | ||||||
|       { |       { | ||||||
|         if (_savefirm == 0) _savefirm = oldfirm;   // E' necessario ricordare la ditta ...
 |         if (_savefirm == 0) _savefirm = oldfirm;   // E' necessario ricordare la ditta ...
 | ||||||
|         prefix().set(tipodir == 1 ? "com" : "");   // ... se si setta il prefix a com
 |         prefix().set(tipodir == 1 ? "com" : "");   // ... se si setta il prefix a com
 | ||||||
|         return TRUE; |         return true; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @ -798,9 +798,10 @@ bool TApplication::set_firm(long newfirm) | |||||||
|     WINDOW w = cur_win(); |     WINDOW w = cur_win(); | ||||||
|     if (w != NULL_WIN) |     if (w != NULL_WIN) | ||||||
|     { |     { | ||||||
|       TWindow * win = (TWindow *) xvt_vobj_get_data(w); |       TWindow* win = (TWindow*) xvt_vobj_get_data(w); | ||||||
|       win->on_firm_change(); |       win->on_firm_change(); | ||||||
|     } |     } | ||||||
|  |     xvtil_statbar_set("", true); // Aggiorna nome ditta nella barra
 | ||||||
|     on_firm_change(); |     on_firm_change(); | ||||||
|     on_config_change(); |     on_config_change(); | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -1,9 +1,10 @@ | |||||||
| // Header file for PRINT SETUP mask
 | // Header file for PRINT SETUP mask
 | ||||||
| 
 | 
 | ||||||
| #define MSK_TYPE     101 | #define MSK_TYPE        101 | ||||||
| #define MSK_FILENAME 102 | #define MSK_FILENAME    102 | ||||||
| #define MSK_PRINTERS 103 | #define MSK_PRINTERS    103 | ||||||
| #define MSK_ISGRAPHICS 334 | #define MSK_ORIENTATION 333 | ||||||
| #define MSK_SIZE       335 | #define MSK_ISGRAPHICS  334 | ||||||
| #define MSK_LINES      336 | #define MSK_SIZE        335 | ||||||
| #define MSK_FONT       338 | #define MSK_LINES       336 | ||||||
|  | #define MSK_FONT        338 | ||||||
|  | |||||||
| @ -14,7 +14,7 @@ BEGIN | |||||||
|   FLAGS "Z"      |   FLAGS "Z"      | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| LIST MSK_PRINTERS 65 | LIST MSK_PRINTERS 64 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 1 3 "Stampante " |   PROMPT 1 3 "Stampante " | ||||||
| END | END | ||||||
| @ -28,9 +28,9 @@ BEGIN | |||||||
|   WARNING "E' necessario specificare un nome di file" |   WARNING "E' necessario specificare un nome di file" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| GROUPBOX DLG_NULL 76 4 | GROUPBOX DLG_NULL 42 5 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 1 4 "@bParametri di stampa" |   PROMPT 1 4 "@bCarattere standard" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| LIST MSK_FONT 32 | LIST MSK_FONT 32 | ||||||
| @ -41,13 +41,13 @@ END | |||||||
|     |     | ||||||
| LIST MSK_SIZE 3 | LIST MSK_SIZE 3 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 50 5 "Dimensioni carattere "  |   PROMPT 2 6 "Dimensioni carattere "  | ||||||
|   ITEM "10|10" |   ITEM "10|10" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| LIST MSK_LINES 3 | LIST MSK_LINES 3 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 50 6 "Linee per pollice    "  |   PROMPT 2 7 "Linee per pollice    "  | ||||||
|   ITEM "4|4" |   ITEM "4|4" | ||||||
|   ITEM "5|5" |   ITEM "5|5" | ||||||
|   ITEM "6|6" |   ITEM "6|6" | ||||||
| @ -57,11 +57,27 @@ BEGIN | |||||||
|   ITEM "10|10"       |   ITEM "10|10"       | ||||||
| END     | END     | ||||||
|         |         | ||||||
|  | GROUPBOX DLG_NULL 33 5 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 44 4 "@bParametri di stampa" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | RADIOBUTTON MSK_ORIENTATION 1 20 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 45 4 "" | ||||||
|  |   ITEM "1|Foglio verticale" | ||||||
|  |   ITEM "2|Foglio orizzontale" | ||||||
|  | END | ||||||
|  | 
 | ||||||
| BOOLEAN MSK_ISGRAPHICS | BOOLEAN MSK_ISGRAPHICS | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 2 6 "Stampa elementi grafici" |   PROMPT 46 7 "Stampa elementi grafici" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | ENDPAGE | ||||||
|  | 
 | ||||||
|  | TOOLBAR "tobpar" 0 0 0 2 | ||||||
|  | 
 | ||||||
| BUTTON DLG_SETPRINT 10 2 | BUTTON DLG_SETPRINT 10 2 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT -14 -1 "~Imposta" |   PROMPT -14 -1 "~Imposta" | ||||||
|  | |||||||
| @ -4087,6 +4087,42 @@ bool TRectype::edit(int logicnum, const char* alternate_key_fields, const char* | |||||||
|   return ok; |   return ok; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | bool TRectype::set_edit_info(const char* ut, const char* dt, const char* or) | ||||||
|  | { | ||||||
|  |   bool ok = false; | ||||||
|  |   if (num() > LF_TAB) // Inutile tentare di gestire le tabelle
 | ||||||
|  |   { | ||||||
|  |     // Se esiste un campo alfanumerioco UT*
 | ||||||
|  |     if (ut && *ut && type(ut) == _alfafld)    | ||||||
|  |     { | ||||||
|  |       put(ut, user()); // Scrivi utente corrente
 | ||||||
|  |       ok = true; | ||||||
|  | 
 | ||||||
|  |       // Se esiste un campo data DT*
 | ||||||
|  |       if (dt && *dt && type(dt) == _datefld)  | ||||||
|  |       { | ||||||
|  |         const TDate oggi(TODAY); | ||||||
|  |         put(dt, oggi); // Scrivi data odierna
 | ||||||
|  | 
 | ||||||
|  |         // Se esisnte un campo long OR*
 | ||||||
|  |         if (or && *or && (type(or) == _longfld || type(or) == _longzerofld)) | ||||||
|  |           put(or, daytime()); // Scrivi ora attuale HHMMSS
 | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   return ok; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool TRectype::set_modify_info() | ||||||
|  | { | ||||||
|  |   return set_edit_info("UTCREAZ", "DTCREAZ", "ORCREAZ"); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool TRectype::set_creation_info() | ||||||
|  | { | ||||||
|  |   return set_edit_info("UTULAGG", "DTULAGG", "ORULAGG"); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| ///////////////////////////////////////////////////////////
 | ///////////////////////////////////////////////////////////
 | ||||||
| // TRecfield (campo/sottocampo di un record)
 | // TRecfield (campo/sottocampo di un record)
 | ||||||
| ///////////////////////////////////////////////////////////
 | ///////////////////////////////////////////////////////////
 | ||||||
|  | |||||||
| @ -98,6 +98,8 @@ protected: | |||||||
|   // @cmember Setta il contenuto del campo <p fieldname> (non tipizzata)
 |   // @cmember Setta il contenuto del campo <p fieldname> (non tipizzata)
 | ||||||
|   virtual void put_str(const char* fieldname, const char* val); |   virtual void put_str(const char* fieldname, const char* val); | ||||||
| 
 | 
 | ||||||
|  |   bool set_edit_info(const char* ut, const char* dt, const char* or); | ||||||
|  | 
 | ||||||
| // @access Public Member
 | // @access Public Member
 | ||||||
| public: | public: | ||||||
|   // @cmember Duplica il tipo di record
 |   // @cmember Duplica il tipo di record
 | ||||||
| @ -261,6 +263,9 @@ public: | |||||||
|   virtual bool get_relapp(TString& app) const; |   virtual bool get_relapp(TString& app) const; | ||||||
|   virtual bool edit(int logicnum = 0, const char * alternate_key_fields = NULL, const char* hint = NULL) const; |   virtual bool edit(int logicnum = 0, const char * alternate_key_fields = NULL, const char* hint = NULL) const; | ||||||
| 
 | 
 | ||||||
|  |   virtual bool set_modify_info(); | ||||||
|  |   virtual bool set_creation_info(); | ||||||
|  | 
 | ||||||
|   // @cmember Inizializza un record staccato da un file.
 |   // @cmember Inizializza un record staccato da un file.
 | ||||||
|   void init(int logicnum); |   void init(int logicnum); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -69,7 +69,6 @@ void TPrinter_setup_mask::fill_font_list() | |||||||
|   }   |   }   | ||||||
|    |    | ||||||
|   TString oldfont = _font; // Memorizzo il font corrente in quanto poi cambia
 |   TString oldfont = _font; // Memorizzo il font corrente in quanto poi cambia
 | ||||||
| 
 |  | ||||||
|   TList_field& lst = (TList_field&)field(MSK_FONT); |   TList_field& lst = (TList_field&)field(MSK_FONT); | ||||||
|   lst.replace_items(fn, fn);   |   lst.replace_items(fn, fn);   | ||||||
| 
 | 
 | ||||||
| @ -77,6 +76,11 @@ void TPrinter_setup_mask::fill_font_list() | |||||||
|   if (fn.get_pos(oldfont) < 0) |   if (fn.get_pos(oldfont) < 0) | ||||||
|     oldfont = fn.get(0); |     oldfont = fn.get(0); | ||||||
|   set(MSK_FONT, oldfont, 0x1); |   set(MSK_FONT, oldfont, 0x1); | ||||||
|  | 
 | ||||||
|  |   long ph, pw; | ||||||
|  |   xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _pcd, &ph, &pw, NULL, NULL); | ||||||
|  |   const int priter_orientation = ph > pw ? 1 : 2; | ||||||
|  |   set(MSK_ORIENTATION, ph > pw ? 1 : 2); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TPrinter_setup_mask::fill_size_list() | void TPrinter_setup_mask::fill_size_list() | ||||||
| @ -114,7 +118,7 @@ void TPrinter_setup_mask::fill_size_list() | |||||||
| bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) | bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) | ||||||
| { | { | ||||||
|   if (_skip_events) |   if (_skip_events) | ||||||
|     return TRUE; |     return true; | ||||||
| 
 | 
 | ||||||
|   switch (o.dlg()) |   switch (o.dlg()) | ||||||
|   { |   { | ||||||
| @ -152,16 +156,27 @@ bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, lon | |||||||
|       {                          |       {                          | ||||||
|         // see if user has changed printer
 |         // see if user has changed printer
 | ||||||
|         // determine name of currently selected printer 
 |         // determine name of currently selected printer 
 | ||||||
|         TString name; |         TString256 name; | ||||||
|         xvt_print_get_name(_pcd, name.get_buffer(), name.size()); |         xvt_print_get_name(_pcd, name.get_buffer(), name.size()); | ||||||
|         set(MSK_PRINTERS, name, 0x1);     |         set(MSK_PRINTERS, name, 0x1);     | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     break; |     break; | ||||||
|  |   case MSK_ORIENTATION: | ||||||
|  |     if (e == fe_modify || e == fe_close) | ||||||
|  |     { | ||||||
|  |       long ph, pw; | ||||||
|  |       xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _pcd, &ph, &pw, NULL, NULL); | ||||||
|  |       const int priter_orientation = ph > pw ? 1 : 2; | ||||||
|  |       const int user_orientation = atoi(o.get()); | ||||||
|  |       if (user_orientation != priter_orientation) // Scambia orientamento della carta
 | ||||||
|  |         xvt_app_escape(XVT_ESC_SET_PRINTER_INFO, _pcd, &pw, &ph, NULL, NULL); | ||||||
|  |     } | ||||||
|  |     break; | ||||||
|   default: |   default: | ||||||
|     break; |     break; | ||||||
|   } |   } | ||||||
|   return TRUE; |   return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TPrinter_setup_mask::TPrinter_setup_mask()  | TPrinter_setup_mask::TPrinter_setup_mask()  | ||||||
| @ -186,7 +201,7 @@ TPrinter_setup_mask::TPrinter_setup_mask() | |||||||
|   } |   } | ||||||
|   xvt_slist_destroy(plist); |   xvt_slist_destroy(plist); | ||||||
| 
 | 
 | ||||||
|   _skip_events = TRUE; |   _skip_events = true; | ||||||
|    |    | ||||||
|   if (pr._printertype == fileprinter) |   if (pr._printertype == fileprinter) | ||||||
|     set (MSK_TYPE, "1"); |     set (MSK_TYPE, "1"); | ||||||
| @ -206,14 +221,14 @@ TPrinter_setup_mask::TPrinter_setup_mask() | |||||||
|   set(MSK_FONT, _font);       // Fare solo quando la lista e' piena
 |   set(MSK_FONT, _font);       // Fare solo quando la lista e' piena
 | ||||||
|   set(MSK_SIZE, pr._ch_size); // Fare solo quando la lista e' piena
 |   set(MSK_SIZE, pr._ch_size); // Fare solo quando la lista e' piena
 | ||||||
|   set(MSK_LINES, pr._lines_per_inch); |   set(MSK_LINES, pr._lines_per_inch); | ||||||
|  | 
 | ||||||
|   set(MSK_ISGRAPHICS, pr.isgraphics() ? "X" : ""); |   set(MSK_ISGRAPHICS, pr.isgraphics() ? "X" : ""); | ||||||
| 
 | 
 | ||||||
|   _skip_events = FALSE; |   _skip_events = false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TPrinter_setup_mask::~TPrinter_setup_mask() | TPrinter_setup_mask::~TPrinter_setup_mask() | ||||||
| { | { } | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| ///////////////////////////////////////////////////////////
 | ///////////////////////////////////////////////////////////
 | ||||||
| // TPrinter
 | // TPrinter
 | ||||||
| @ -1218,10 +1233,10 @@ void TPrinter::init_formlen( | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TPrinter::TPrinter() | TPrinter::TPrinter() | ||||||
| : _vf(NULL), _ch_size (12), _date (TODAY), _multiple_link (FALSE), | : _vf(NULL), _ch_size (12), _date (TODAY), _multiple_link (false), | ||||||
|   _isgraphics (TRUE), _frozen (FALSE), _print_rcd(NULL), _lines_per_inch (6), |   _isgraphics (true), _frozen (false), _print_rcd(NULL), _lines_per_inch (6), | ||||||
|   _l_offset(0), _c_offset(0), _export_header(FALSE), _export_header_len(0), |   _l_offset(0), _c_offset(0), _export_header(false), _export_header_len(0), | ||||||
|   _appendfile(FALSE) |   _appendfile(false), _manual_setup(false) | ||||||
| 
 | 
 | ||||||
| { | { | ||||||
|   _footerhandler = _headerhandler = NULL; |   _footerhandler = _headerhandler = NULL; | ||||||
| @ -1232,15 +1247,13 @@ TPrinter::TPrinter() | |||||||
| 
 | 
 | ||||||
|   _frompage = 0; |   _frompage = 0; | ||||||
|   _topage = 0xffff; |   _topage = 0xffff; | ||||||
|   _hwformfeed = FALSE; |   _hwformfeed = false; | ||||||
|   _currentpage = 1; |   _currentpage = 1; | ||||||
|   _currentrow = 1; |   _currentrow = 1; | ||||||
|   _fp = NULL; |   _fp = NULL; | ||||||
|   _headersize = 0; |   _headersize = 0; | ||||||
|   _footersize = 0; |   _footersize = 0; | ||||||
|   _isopen = FALSE; |   _isopen = false; | ||||||
|    |  | ||||||
| //  xvt_print_get_default_device(_defPrinter.get_buffer(), _defPrinter.size());
 |  | ||||||
|    |    | ||||||
| 	// read configuration file
 | 	// read configuration file
 | ||||||
|   read_configuration (); |   read_configuration (); | ||||||
| @ -1249,7 +1262,7 @@ TPrinter::TPrinter() | |||||||
|    |    | ||||||
|   set_fincatura("+++++++++-|");                 |   set_fincatura("+++++++++-|");                 | ||||||
| 
 | 
 | ||||||
|   set_fink_mode(TRUE); |   set_fink_mode(true); | ||||||
|   _finker = _isgraphics && _fink_mode ? NULL : new TPrint_intersector(_fink, _formlen); |   _finker = _isgraphics && _fink_mode ? NULL : new TPrint_intersector(_fink, _formlen); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -1281,14 +1294,14 @@ void TPrinter::read_configuration( | |||||||
|     iniptr = new TConfig(CONFIG_GUI, "Printer"); |     iniptr = new TConfig(CONFIG_GUI, "Printer"); | ||||||
| 
 | 
 | ||||||
|   const int what = iniptr->get_int("Type", NULL, -1, 4);      // Tipo stampante
 |   const int what = iniptr->get_int("Type", NULL, -1, 4);      // Tipo stampante
 | ||||||
|   _prname = iniptr->get("Name", NULL, -1, _defPrinter);       // Nome stampante corrente
 |   _prname = iniptr->get("Name");                              // Nome stampante corrente
 | ||||||
|   _printerfile = iniptr->get("File", NULL, -1, "");           // File di stampa                
 |   _printerfile = iniptr->get("File", NULL, -1, "");           // File di stampa                
 | ||||||
|   set_fontname(iniptr->get("Font", NULL, -1, XVT_FFN_FIXED));   // Nome del font
 |   set_fontname(iniptr->get("Font", NULL, -1, XVT_FFN_FIXED));   // Nome del font
 | ||||||
|   _ch_size = iniptr->get_int("Size", NULL, -1, 10);           // Dimensione del font
 |   _ch_size = iniptr->get_int("Size", NULL, -1, 10);           // Dimensione del font
 | ||||||
|   _lines_per_inch = iniptr->get_int("Lines", NULL, -1, 6);    // Linee per pollice
 |   _lines_per_inch = iniptr->get_int("Lines", NULL, -1, 6);    // Linee per pollice
 | ||||||
|   set_graphics(iniptr->get_bool("Graphic", NULL, -1, TRUE));  // Grafica attiva
 |   set_graphics(iniptr->get_bool("Graphic", NULL, -1, true));  // Grafica attiva
 | ||||||
| 
 | 
 | ||||||
| 	bool read_rcd = FALSE; | 	bool read_rcd = false; | ||||||
| 	 | 	 | ||||||
| 	const TString& host = iniptr->get("Host"); | 	const TString& host = iniptr->get("Host"); | ||||||
| 	if (host.not_empty()) | 	if (host.not_empty()) | ||||||
| @ -1369,10 +1382,12 @@ void TPrinter::read_configuration( | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void TPrinter::save_configuration() | void TPrinter::save_configuration(const char* para) | ||||||
| {  | {  | ||||||
|   TWait_cursor hourglass; |   TWait_cursor hourglass; | ||||||
| 
 | 
 | ||||||
|  |   if (para && *para) | ||||||
|  |     _config = para; | ||||||
|   CHECK(_config.not_empty(), "Invalid printer config"); |   CHECK(_config.not_empty(), "Invalid printer config"); | ||||||
|   TConfig prini(_config == "Printer" ? CONFIG_GUI : CONFIG_STAMPE, _config); |   TConfig prini(_config == "Printer" ? CONFIG_GUI : CONFIG_STAMPE, _config); | ||||||
|    |    | ||||||
| @ -1401,12 +1416,12 @@ void TPrinter::save_configuration() | |||||||
|     n++; |     n++; | ||||||
|     if (n == 24) |     if (n == 24) | ||||||
|     { |     { | ||||||
|       prini.set("rcd", val, NULL, TRUE, index++); |       prini.set("rcd", val, NULL, true, index++); | ||||||
|       val.cut(n = 0); |       val.cut(n = 0); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   if (n > 0) |   if (n > 0) | ||||||
|     prini.set("rcd", val, NULL, TRUE, index); |     prini.set("rcd", val, NULL, true, index); | ||||||
|    |    | ||||||
|   for (index++; prini.remove("rcd", index); index++); |   for (index++; prini.remove("rcd", index); index++); | ||||||
| } | } | ||||||
| @ -1418,7 +1433,6 @@ TPrinter::~TPrinter () | |||||||
|     xvt_print_destroy(_print_rcd); |     xvt_print_destroy(_print_rcd); | ||||||
|     _print_rcd = NULL; |     _print_rcd = NULL; | ||||||
|   }                                                      |   }                                                      | ||||||
| //  xvt_print_set_default_device(_defPrinter);
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const char* TPrinter::class_name() const | const char* TPrinter::class_name() const | ||||||
| @ -1505,19 +1519,19 @@ void TPrinter::resetfooter () | |||||||
| //
 | //
 | ||||||
| // @rdesc Ritorna il risulato della stampa:
 | // @rdesc Ritorna il risulato della stampa:
 | ||||||
| //
 | //
 | ||||||
| // @flag TRUE | Se la stampa ha avuto successo
 | // @flag true | Se la stampa ha avuto successo
 | ||||||
| // @flag FALSE | Se la stampante non e' attiva
 | // @flag false | Se la stampante non e' attiva
 | ||||||
| bool TPrinter::printrow( | bool TPrinter::printrow( | ||||||
|   TPrintrow* rowtoprint) // @parm Riga da stampare
 |   TPrintrow* rowtoprint) // @parm Riga da stampare
 | ||||||
| 
 | 
 | ||||||
|   // @comm Se la pagina logica corrente e' precedente alla prima pagina logica o successiva
 |   // @comm Se la pagina logica corrente e' precedente alla prima pagina logica o successiva
 | ||||||
|   //     all'ultima pagina logica viene ritornato TRUE.
 |   //     all'ultima pagina logica viene ritornato true.
 | ||||||
| { | { | ||||||
|   if (!isopen ()) |   if (!isopen ()) | ||||||
|     return FALSE; |     return false; | ||||||
| 
 | 
 | ||||||
|   if (_currentpage < _frompage || _currentpage > _topage) |   if (_currentpage < _frompage || _currentpage > _topage) | ||||||
|     return TRUE; |     return true; | ||||||
| 
 | 
 | ||||||
|   TString rw (rowtoprint == NULL ? "" : ((_printertype == screenvis || _printertype == winprinter ||  |   TString rw (rowtoprint == NULL ? "" : ((_printertype == screenvis || _printertype == winprinter ||  | ||||||
|                                          _printertype == exportprinter) ?  |                                          _printertype == exportprinter) ?  | ||||||
| @ -1557,7 +1571,7 @@ bool TPrinter::printrow( | |||||||
|     if (!_vf->frozen ()) |     if (!_vf->frozen ()) | ||||||
|       _vf->add_line(rw); |       _vf->add_line(rw); | ||||||
|     else |     else | ||||||
|       _frozen = TRUE; |       _frozen = true; | ||||||
|   } |   } | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
| @ -1583,8 +1597,8 @@ word TPrinter::rows_left() const | |||||||
| //
 | //
 | ||||||
| // @rdesc Ritorna il risultato della stampa:
 | // @rdesc Ritorna il risultato della stampa:
 | ||||||
| //
 | //
 | ||||||
| // @flag TRUE | Se la stampa ha avuto successo
 | // @flag true | Se la stampa ha avuto successo
 | ||||||
| // @flag FALSE | Se non e' riuscito ad effettuare la stampa
 | // @flag false | Se non e' riuscito ad effettuare la stampa
 | ||||||
| bool TPrinter::print( | bool TPrinter::print( | ||||||
|   TPrintrow& rowtoprint)        // @parm Riga da stampare
 |   TPrintrow& rowtoprint)        // @parm Riga da stampare
 | ||||||
| 
 | 
 | ||||||
| @ -1592,7 +1606,7 @@ bool TPrinter::print( | |||||||
|   //     della pagina corrente e l'header della successiva prima prima della stampa della riga
 |   //     della pagina corrente e l'header della successiva prima prima della stampa della riga
 | ||||||
|   //     vera e propria.
 |   //     vera e propria.
 | ||||||
| { | { | ||||||
|   bool ok = TRUE; |   bool ok = true; | ||||||
| 
 | 
 | ||||||
|   if (!(_printertype == exportprinter && !_export_header)) |   if (!(_printertype == exportprinter && !_export_header)) | ||||||
|   { |   { | ||||||
| @ -1616,7 +1630,7 @@ bool TPrinter::printheader() | |||||||
|   if (_headerhandler) |   if (_headerhandler) | ||||||
|     _headerhandler(*this); |     _headerhandler(*this); | ||||||
| 
 | 
 | ||||||
|   bool ok = TRUE; |   bool ok = true; | ||||||
|   int i; |   int i; | ||||||
|    |    | ||||||
|   for (i = 0; i < _headersize && ok; i++) |   for (i = 0; i < _headersize && ok; i++) | ||||||
| @ -1633,7 +1647,7 @@ bool TPrinter::printfooter() | |||||||
|   if (_footerhandler) |   if (_footerhandler) | ||||||
|     _footerhandler (*this); |     _footerhandler (*this); | ||||||
| 
 | 
 | ||||||
|   bool ok = TRUE; |   bool ok = true; | ||||||
|   for (int i = 0; i < _footersize && ok; i++) |   for (int i = 0; i < _footersize && ok; i++) | ||||||
|     ok = printrow(getfooterline(i)); |     ok = printrow(getfooterline(i)); | ||||||
| 
 | 
 | ||||||
| @ -1649,11 +1663,11 @@ bool TPrinter::printfooter() | |||||||
| void TPrinter::set_fink_mode( | void TPrinter::set_fink_mode( | ||||||
|   bool f)      // @parm Indica il tipo di fincatura:
 |   bool f)      // @parm Indica il tipo di fincatura:
 | ||||||
|   //
 |   //
 | ||||||
|   // @flag TRUE | Fincatura di tipo grafico
 |   // @flag true | Fincatura di tipo grafico
 | ||||||
|   // @flag FALSE | Fincatura di tipo testo
 |   // @flag false | Fincatura di tipo testo
 | ||||||
| 
 | 
 | ||||||
|   // @comm Viene prima controllato che la stampante supporti la modalita' grafica,
 |   // @comm Viene prima controllato che la stampante supporti la modalita' grafica,
 | ||||||
|   //       in tal caso, se viene impostato il flag a TRUE e la stampante e' generica
 |   //       in tal caso, se viene impostato il flag a true e la stampante e' generica
 | ||||||
|   //       oppure non ha il flag di stampa elementi grafici attivato, la fincatura sara'
 |   //       oppure non ha il flag di stampa elementi grafici attivato, la fincatura sara'
 | ||||||
|   //       in modo testo.
 |   //       in modo testo.
 | ||||||
| { | { | ||||||
| @ -1666,8 +1680,8 @@ void TPrinter::set_fink_mode( | |||||||
| //
 | //
 | ||||||
| // @rdesc Ritorna il risulato dell'operazione:
 | // @rdesc Ritorna il risulato dell'operazione:
 | ||||||
| //
 | //
 | ||||||
| // @flag TRUE | Se e' riuscito a saltare le righe
 | // @flag true | Se e' riuscito a saltare le righe
 | ||||||
| // @flag FALSE | Se non e' riuscito a saltare le righe
 | // @flag false | Se non e' riuscito a saltare le righe
 | ||||||
| bool TPrinter::skip( | bool TPrinter::skip( | ||||||
|   int linestoskip)      // @parm Vengono accettati solo valori positivi
 |   int linestoskip)      // @parm Vengono accettati solo valori positivi
 | ||||||
| 
 | 
 | ||||||
| @ -1684,8 +1698,8 @@ bool TPrinter::skip( | |||||||
| //
 | //
 | ||||||
| // @rdesc Ritorna il risultato dell'operazione
 | // @rdesc Ritorna il risultato dell'operazione
 | ||||||
| //
 | //
 | ||||||
| // @flag TRUE | Se e' riuscito a saltare alla riga
 | // @flag true | Se e' riuscito a saltare alla riga
 | ||||||
| // @flag FALSE | Se non e' riuscito a saltare alla riga o se viene inserito un formfeed
 | // @flag false | Se non e' riuscito a saltare alla riga o se viene inserito un formfeed
 | ||||||
| bool TPrinter::jump( | bool TPrinter::jump( | ||||||
|   int jumpline) // @parm Numero della riga a cui saltare nella stampa. Vengono accettai
 |   int jumpline) // @parm Numero della riga a cui saltare nella stampa. Vengono accettai
 | ||||||
|   //     solo valori positivi
 |   //     solo valori positivi
 | ||||||
| @ -1696,7 +1710,7 @@ bool TPrinter::jump( | |||||||
|   // @xref <mf TPrinter::skip>
 |   // @xref <mf TPrinter::skip>
 | ||||||
| { | { | ||||||
|   int i = 0; |   int i = 0; | ||||||
|   bool ok = TRUE; |   bool ok = true; | ||||||
| 
 | 
 | ||||||
|   CHECK (jumpline >= 0, "Jumpline can't be negative"); |   CHECK (jumpline >= 0, "Jumpline can't be negative"); | ||||||
|   if (jumpline > _formlen - _footersize) |   if (jumpline > _formlen - _footersize) | ||||||
| @ -1704,9 +1718,9 @@ bool TPrinter::jump( | |||||||
|   else |   else | ||||||
|     for (i = _currentrow; i < jumpline; i++) |     for (i = _currentrow; i < jumpline; i++) | ||||||
|       if (!printrow()) |       if (!printrow()) | ||||||
|         ok = FALSE; |         ok = false; | ||||||
|   if (jumpline > _formlen - _footersize) |   if (jumpline > _formlen - _footersize) | ||||||
|     ok = FALSE; |     ok = false; | ||||||
|   return ok; |   return ok; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -1728,12 +1742,10 @@ void TPrinter::reset() | |||||||
| 
 | 
 | ||||||
| bool TPrinter::open() | bool TPrinter::open() | ||||||
| { | { | ||||||
| //  xvt_print_set_default_device(_prname);
 |  | ||||||
| 
 |  | ||||||
|   if (_printertype == screenvis) |   if (_printertype == screenvis) | ||||||
|   {  |   {  | ||||||
|     CHECK(_vf == NULL, "Print preview already open"); |     CHECK(_vf == NULL, "Print preview already open"); | ||||||
|     _vf = new TViswin (NULL, "Anteprima di stampa", TRUE, TRUE, |     _vf = new TViswin (NULL, "Anteprima di stampa", true, true, | ||||||
|                        _linksdescr.items () > 0); |                        _linksdescr.items () > 0); | ||||||
|     _vf->open_modal (); |     _vf->open_modal (); | ||||||
|   } |   } | ||||||
| @ -1741,13 +1753,13 @@ bool TPrinter::open() | |||||||
|   { |   { | ||||||
|     // prepare text object for new text
 |     // prepare text object for new text
 | ||||||
|     _txt.destroy(); |     _txt.destroy(); | ||||||
|     _txt.interactive(FALSE); |     _txt.interactive(false); | ||||||
|   }   |   }   | ||||||
| 
 | 
 | ||||||
|   _currentrow = 1; |   _currentrow = 1; | ||||||
|   _currentpage = 1; |   _currentpage = 1; | ||||||
| 
 | 
 | ||||||
|   return _isopen = TRUE; |   return _isopen = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool TPrinter::set() | bool TPrinter::set() | ||||||
| @ -1772,6 +1784,7 @@ bool TPrinter::set() | |||||||
|   } |   } | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
|  |     _manual_setup = true; | ||||||
|     _prname = mask.get(MSK_PRINTERS); |     _prname = mask.get(MSK_PRINTERS); | ||||||
| 
 | 
 | ||||||
|     switch (atoi (mask.get (MSK_TYPE))) |     switch (atoi (mask.get (MSK_TYPE))) | ||||||
| @ -1800,7 +1813,7 @@ bool TPrinter::set() | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   main_app().enable_menu_item (M_FILE_PG_SETUP); |   main_app().enable_menu_item (M_FILE_PG_SETUP); | ||||||
|   return TRUE; |   return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -1811,8 +1824,8 @@ void TPrinter::merge_export_file( | |||||||
|   const char* file,  |   const char* file,  | ||||||
|   bool header)  // @parm Indica se gli header sono presenti nel file:
 |   bool header)  // @parm Indica se gli header sono presenti nel file:
 | ||||||
|   //
 |   //
 | ||||||
|   // @flag TRUE | Gli header sono nel file e quindi non vengono stampanti (default)
 |   // @flag true | Gli header sono nel file e quindi non vengono stampanti (default)
 | ||||||
|   // @flag FALSE | Gli header non sono nel file e quindi vengono stampanti
 |   // @flag false | Gli header non sono nel file e quindi vengono stampanti
 | ||||||
| 
 | 
 | ||||||
|   // @comm Vengono inseriti nel file di export i formati e tutto il resto. Vengono ignorati gli
 |   // @comm Vengono inseriti nel file di export i formati e tutto il resto. Vengono ignorati gli
 | ||||||
|   //     header supponendo che siano gia' presenti nel file
 |   //     header supponendo che siano gia' presenti nel file
 | ||||||
| @ -1922,7 +1935,7 @@ void TPrinter::close () | |||||||
|      |      | ||||||
|     if (key == K_CTRL+'S') |     if (key == K_CTRL+'S') | ||||||
|     { |     { | ||||||
|       _isopen = FALSE; |       _isopen = false; | ||||||
|       _currentrow = _currentpage = 1; |       _currentrow = _currentpage = 1; | ||||||
|       print_txt(_vf->text()); |       print_txt(_vf->text()); | ||||||
|     } |     } | ||||||
| @ -1965,8 +1978,8 @@ void TPrinter::close () | |||||||
|    |    | ||||||
|   // Dealloca sfondi ormai inutili
 |   // Dealloca sfondi ormai inutili
 | ||||||
|   _backgrounds.destroy(); |   _backgrounds.destroy(); | ||||||
|   freeze (FALSE);              |   freeze (false);              | ||||||
|   _isopen = FALSE; |   _isopen = false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //  
 | //  
 | ||||||
| @ -1988,8 +2001,8 @@ TFile_printer::TFile_printer (const char *ffile, const char *label, int len_rec, | |||||||
|   _volume = 1; |   _volume = 1; | ||||||
|   _size = disk_sizes[tipo_disco]; |   _size = disk_sizes[tipo_disco]; | ||||||
|   _num_rec_volume = int ((_size / len_rec) - _num_rec_testa_coda); |   _num_rec_volume = int ((_size / len_rec) - _num_rec_testa_coda); | ||||||
|   _nome_file_fissato = TRUE; |   _nome_file_fissato = true; | ||||||
|   _label_fissata = TRUE; |   _label_fissata = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TFile_printer::open() | void TFile_printer::open() | ||||||
| @ -2015,7 +2028,7 @@ bool TFile_printer::genera_dischetti () | |||||||
|     // copia il file sul dischetto
 |     // copia il file sul dischetto
 | ||||||
|     fcopy ((const char *) &_tmp_files[i], (const char *) _drive); |     fcopy ((const char *) &_tmp_files[i], (const char *) _drive); | ||||||
|   } |   } | ||||||
|   return TRUE; |   return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TFile_printer::~TFile_printer () | TFile_printer::~TFile_printer () | ||||||
| @ -2173,3 +2186,13 @@ int TPrinter::calc_num_cols() const | |||||||
|    |    | ||||||
|   return numcols; |   return numcols; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | void TPrinter::set_portrait_orientation(bool portrait) | ||||||
|  | { | ||||||
|  |   long pw, ph; // Printer width, height
 | ||||||
|  |   PRINT_RCD* rcd = get_printrcd(); | ||||||
|  |   xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, rcd, &ph, &pw, NULL, NULL); | ||||||
|  |   const bool is_portrait = ph >= pw; | ||||||
|  |   if (portrait != is_portrait) | ||||||
|  |     xvt_app_escape(XVT_ESC_SET_PRINTER_INFO, rcd, &pw, &ph, NULL, NULL); | ||||||
|  | } | ||||||
|  | |||||||
| @ -192,8 +192,6 @@ class TPrinter : public TObject | |||||||
|   FILE* _fp; |   FILE* _fp; | ||||||
|   // @cmember:(INTERNAL) Puntatore al file di visualizzaizone
 |   // @cmember:(INTERNAL) Puntatore al file di visualizzaizone
 | ||||||
|   TViswin* _vf; |   TViswin* _vf; | ||||||
|   // @cmember:(INTERNAL) Stampante di default di sistema       
 |  | ||||||
|   TString _defPrinter;        |  | ||||||
|   // @cmember:(INTERNAL) Testo da stampare
 |   // @cmember:(INTERNAL) Testo da stampare
 | ||||||
|   TTextfile _txt; |   TTextfile _txt; | ||||||
|   // @cmember:(INTERNAL) Nome del file di esportazione
 |   // @cmember:(INTERNAL) Nome del file di esportazione
 | ||||||
| @ -299,6 +297,7 @@ class TPrinter : public TObject | |||||||
|   // @cmember:(INTERNAL) Fincatore per modo testo
 |   // @cmember:(INTERNAL) Fincatore per modo testo
 | ||||||
|   TPrint_intersector* _finker;  |   TPrint_intersector* _finker;  | ||||||
| 
 | 
 | ||||||
|  |   bool _manual_setup; | ||||||
|    |    | ||||||
|   // @access Protected Member
 |   // @access Protected Member
 | ||||||
| protected: | protected: | ||||||
| @ -315,9 +314,6 @@ protected: | |||||||
|   // @cmember Stampa il footer della pagina
 |   // @cmember Stampa il footer della pagina
 | ||||||
|   bool printfooter(); |   bool printfooter(); | ||||||
| 
 | 
 | ||||||
|   // @cmember Salva i parametri di configurazione correnti
 |  | ||||||
|   void save_configuration(); |  | ||||||
|    |  | ||||||
|   // @access Public Member
 |   // @access Public Member
 | ||||||
| public: | public: | ||||||
| 
 | 
 | ||||||
| @ -497,7 +493,6 @@ public: | |||||||
|   char f_vertical() const  |   char f_vertical() const  | ||||||
|   { return _fink[10]; } |   { return _fink[10]; } | ||||||
|    |    | ||||||
| 
 |  | ||||||
|   // @cmember Permette di saltare alcune righe dalla posizione corrente 
 |   // @cmember Permette di saltare alcune righe dalla posizione corrente 
 | ||||||
|   bool skip (int linetoskip); |   bool skip (int linetoskip); | ||||||
|   // @cmember Permette di saltare alla riga indicata
 |   // @cmember Permette di saltare alla riga indicata
 | ||||||
| @ -613,6 +608,8 @@ public: | |||||||
|    |    | ||||||
|   // @cmember Legge la configurazione della stampante
 |   // @cmember Legge la configurazione della stampante
 | ||||||
|   void read_configuration(const char* parag = NULL); |   void read_configuration(const char* parag = NULL); | ||||||
|  |   // @cmember Salva i parametri di configurazione correnti
 | ||||||
|  |   void save_configuration(const char* parag = NULL); | ||||||
| 
 | 
 | ||||||
|   // @cmember Crea un segnalibro
 |   // @cmember Crea un segnalibro
 | ||||||
|   int set_bookmark(const char* txt, int father = -1); |   int set_bookmark(const char* txt, int father = -1); | ||||||
| @ -624,6 +621,10 @@ public: | |||||||
|   int calc_font_size(int columns) const; |   int calc_font_size(int columns) const; | ||||||
|   // @cmember Calcola il numero di colonne per il font/size attuale
 |   // @cmember Calcola il numero di colonne per il font/size attuale
 | ||||||
|   int calc_num_cols() const; |   int calc_num_cols() const; | ||||||
|  | 
 | ||||||
|  |   void set_portrait_orientation(bool port = true); | ||||||
|  |   void set_landscape_orientation(bool land = true) { set_portrait_orientation(!land); }  | ||||||
|  |   bool manual_setup() const { return _manual_setup; } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // @doc EXTERNAL
 | // @doc EXTERNAL
 | ||||||
|  | |||||||
| @ -1151,14 +1151,16 @@ int TRelation_application::read(TMask& m) | |||||||
|   return NOERR; |   return NOERR; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| int TRelation_application::write(const TMask& m) | int TRelation_application::write(const TMask& m) | ||||||
| { | { | ||||||
|   TRelation &r = *get_relation(); |   TRelation &r = *get_relation(); | ||||||
|   m.autosave(r); |   m.autosave(r); | ||||||
|  |   r.curr().set_creation_info(); | ||||||
| 
 | 
 | ||||||
|   // write relation and all independent sheets 
 |   // write relation and all independent sheets 
 | ||||||
|   int err=r.write(); |   int err=r.write(); | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|   const int max = m.fields(); |   const int max = m.fields(); | ||||||
|   for (int i = 0; i < max; i++) |   for (int i = 0; i < max; i++) | ||||||
|   { |   { | ||||||
| @ -1169,6 +1171,13 @@ int TRelation_application::write(const TMask& m) | |||||||
|         err|=f.record()->write(FALSE); |         err|=f.record()->write(FALSE); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | */ | ||||||
|  |   FOR_EACH_MASK_SHEET(m, i, s) | ||||||
|  |   { | ||||||
|  |     if (s->record() && !s->external_record()) | ||||||
|  |       err |= s->record()->write(false); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -1177,9 +1186,12 @@ int TRelation_application::rewrite(const TMask& m) | |||||||
| { | { | ||||||
|   TRelation& r = *get_relation(); |   TRelation& r = *get_relation(); | ||||||
|   m.autosave(r); |   m.autosave(r); | ||||||
|  |   r.curr().set_modify_info(); | ||||||
|   // rewrite relation and all independent sheets 
 |   // rewrite relation and all independent sheets 
 | ||||||
|   r.rewrite(); |   r.rewrite(); | ||||||
|   int err=r.status(); |   int err=r.status(); | ||||||
|  | 
 | ||||||
|  |   /*
 | ||||||
|   const int max = m.fields(); |   const int max = m.fields(); | ||||||
|   for (int i = 0; i < max; i++) |   for (int i = 0; i < max; i++) | ||||||
|   { |   { | ||||||
| @ -1190,6 +1202,13 @@ int TRelation_application::rewrite(const TMask& m) | |||||||
|         err|=f.record()->write(TRUE); |         err|=f.record()->write(TRUE); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |   */ | ||||||
|  |   FOR_EACH_MASK_SHEET(m, i, s) | ||||||
|  |   { | ||||||
|  |     if (s->record() && !s->external_record()) | ||||||
|  |       err |= s->record()->write(true); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1362,14 +1362,19 @@ void TCursor::filter( | |||||||
|   case LF_TAB: |   case LF_TAB: | ||||||
|     { |     { | ||||||
|       const TTable& f = (const TTable&)file(); |       const TTable& f = (const TTable&)file(); | ||||||
|       kf = kto = f.name(); |       // kf = kto = f.name();
 | ||||||
|  |       const TString4 k = f.name(); | ||||||
|  |       kf.overwrite(k, 0); | ||||||
|  |       kto.overwrite(k, 0); | ||||||
|     }; |     }; | ||||||
|     break; |     break; | ||||||
|   case LF_TABMOD: |   case LF_TABMOD: | ||||||
|     { |     { | ||||||
|       const TModule_table& t = (TModule_table&)file(); |       const TModule_table& t = (TModule_table&)file(); | ||||||
|       kf.format("%2s%6ld%3s", (const char*)t.module(), t.customer(), (const char*)t.name()); |       TString16 k; | ||||||
|       kto = kf; |       k.format("%2s%6ld%3s", (const char*)t.module(), t.customer(), (const char*)t.name()); | ||||||
|  |       kf.overwrite(k, 0);  | ||||||
|  |       kto.overwrite(k, 0); | ||||||
|     } |     } | ||||||
|     break; |     break; | ||||||
|   default: |   default: | ||||||
|  | |||||||
| @ -2089,6 +2089,7 @@ bool TReport::load(const char* fname) | |||||||
|     _lpi = xml.GetIntAttr("lpi", 6); |     _lpi = xml.GetIntAttr("lpi", 6); | ||||||
|     _font.load(xml); |     _font.load(xml); | ||||||
|     _use_printer_font = xml.GetBoolAttr("use_printer_font"); |     _use_printer_font = xml.GetBoolAttr("use_printer_font"); | ||||||
|  |     _save_last_printer = xml.GetBoolAttr("save_printer"); | ||||||
|     _orientation = xml.GetIntAttr("orientation"); |     _orientation = xml.GetIntAttr("orientation"); | ||||||
|     _page_split = xml.GetBoolAttr("page_split"); |     _page_split = xml.GetBoolAttr("page_split"); | ||||||
|     _page_merge = xml.GetBoolAttr("page_merge"); |     _page_merge = xml.GetBoolAttr("page_merge"); | ||||||
| @ -2169,6 +2170,7 @@ bool TReport::save(const char* fname) const | |||||||
|     xml.SetAttr("libraries", _include); |     xml.SetAttr("libraries", _include); | ||||||
|     _font.save(xml); |     _font.save(xml); | ||||||
|     xml.SetAttr("use_printer_font", use_printer_font() ? 1 : 0); |     xml.SetAttr("use_printer_font", use_printer_font() ? 1 : 0); | ||||||
|  |     xml.SetAttr("save_printer", save_last_printer() ? 1 : 0); | ||||||
|     xml.SetAttr("orientation", orientation()); |     xml.SetAttr("orientation", orientation()); | ||||||
|     xml.SetAttr("page_split", page_split_allowed()); |     xml.SetAttr("page_split", page_split_allowed()); | ||||||
|     xml.SetAttr("page_merge", page_merge_allowed()); |     xml.SetAttr("page_merge", page_merge_allowed()); | ||||||
| @ -3138,7 +3140,8 @@ bool TReport::archive() | |||||||
| 
 | 
 | ||||||
| TReport::TReport()  | TReport::TReport()  | ||||||
|        : _cpi(0), _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL), |        : _cpi(0), _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL), | ||||||
|          _use_printer_font(false), _orientation(0), _page_split(false), _page_merge(false), _rep_copy(1), _rep_copies(1) |          _use_printer_font(false), _save_last_printer(false), _orientation(0),  | ||||||
|  |          _page_split(false), _page_merge(false), _rep_copy(1), _rep_copies(1) | ||||||
| {  | {  | ||||||
|   _expressions.set_report(this);   |   _expressions.set_report(this);   | ||||||
|   _prescript.set_description("PRESCRIPT"); |   _prescript.set_description("PRESCRIPT"); | ||||||
|  | |||||||
| @ -60,10 +60,6 @@ public: | |||||||
|   XVT_FNTID get_preview_font(const TWindow& win, const TPoint& res) const; |   XVT_FNTID get_preview_font(const TWindow& win, const TPoint& res) const; | ||||||
|   void unmap(); |   void unmap(); | ||||||
| 
 | 
 | ||||||
|   //int leading() const { return _leading; }
 |  | ||||||
|   //int ascent() const { return _ascent; }
 |  | ||||||
|   //int descent() const { return _descent; }
 |  | ||||||
| 
 |  | ||||||
|   void save(TXmlItem& root) const; |   void save(TXmlItem& root) const; | ||||||
|   bool load(const TXmlItem& root); |   bool load(const TXmlItem& root); | ||||||
| 
 | 
 | ||||||
| @ -462,7 +458,7 @@ class TReport : public TAlex_virtual_machine | |||||||
|   TRecordset* _recordset; |   TRecordset* _recordset; | ||||||
|   TReport_expr_cache _expressions; |   TReport_expr_cache _expressions; | ||||||
|   word _rep_page, _book_page, _rep_copy, _rep_copies; |   word _rep_page, _book_page, _rep_copy, _rep_copies; | ||||||
|   bool _use_printer_font; |   bool _use_printer_font, _save_last_printer; | ||||||
|   int _orientation; |   int _orientation; | ||||||
|   TString_array _allegati; |   TString_array _allegati; | ||||||
|   TReport_field* _curr_field; |   TReport_field* _curr_field; | ||||||
| @ -508,6 +504,8 @@ public: | |||||||
|   const TReport_font& print_font() const; |   const TReport_font& print_font() const; | ||||||
|   void set_use_printer_font(bool on) { _use_printer_font = on; } |   void set_use_printer_font(bool on) { _use_printer_font = on; } | ||||||
|   bool use_printer_font() const { return _use_printer_font; } |   bool use_printer_font() const { return _use_printer_font; } | ||||||
|  |   void set_save_last_printer(bool on) { _save_last_printer = on; } | ||||||
|  |   bool save_last_printer() const { return _save_last_printer; } | ||||||
|   void set_orientation(int orion) { _orientation = orion; } |   void set_orientation(int orion) { _orientation = orion; } | ||||||
|   int orientation() const { return _orientation; } |   int orientation() const { return _orientation; } | ||||||
|   const TString& get_class() const { return _class; } |   const TString& get_class() const { return _class; } | ||||||
|  | |||||||
| @ -1882,36 +1882,36 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies) | |||||||
|   if (pages() <= 0) |   if (pages() <= 0) | ||||||
|     return false; |     return false; | ||||||
| 
 | 
 | ||||||
|     if (pagefrom == 0) |   if (pagefrom == 0) | ||||||
|     { |   { | ||||||
|       TPrinter& p = printer(); |     TPrinter& p = printer(); | ||||||
|       TMask msk("bagn003"); |     TMask msk("bagn003"); | ||||||
|       msk.set(F_PRINTER, p.printername()); |     msk.set(F_PRINTER, p.printername()); | ||||||
|       msk.set(F_FORM, p.get_form_name()); |     msk.set(F_FORM, p.get_form_name()); | ||||||
|       msk.set(F_FONT, p.fontname()); |     msk.set(F_FONT, p.fontname()); | ||||||
|       msk.set(F_SIZE, p.get_char_size()); |     msk.set(F_SIZE, p.get_char_size()); | ||||||
|    |    | ||||||
|       msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : ""); |     msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : ""); | ||||||
|       msk.set(F_FROMPAGE, 1); |     msk.set(F_FROMPAGE, 1); | ||||||
|       msk.set(F_TOPAGE, pages()); |     msk.set(F_TOPAGE, pages()); | ||||||
|       msk.set(F_COPIES, 1); |     msk.set(F_COPIES, 1); | ||||||
|       if (msk.run() == K_ENTER) |     if (msk.run() == K_ENTER) | ||||||
|       { |     { | ||||||
|         _copies = msk.get_int(F_COPIES); |       _copies = msk.get_int(F_COPIES); | ||||||
|         _pagefrom = msk.get_int(F_FROMPAGE); |       _pagefrom = msk.get_int(F_FROMPAGE); | ||||||
|         _pageto = msk.get_int(F_TOPAGE); |       _pageto = msk.get_int(F_TOPAGE); | ||||||
|       } |  | ||||||
|       else |  | ||||||
|         return false; |  | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |       return false; | ||||||
|       _pagefrom = pagefrom; |   } | ||||||
|       _pageto = pageto; |   else | ||||||
|       _copies = copies; |   { | ||||||
|     } |     _pagefrom = pagefrom; | ||||||
|  |     _pageto = pageto; | ||||||
|  |     _copies = copies; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|     _pdf_file.cut(0); |   _pdf_file.cut(0); | ||||||
|   return xvt_print_start_thread(main_loop_callback, (long)this) != 0; |   return xvt_print_start_thread(main_loop_callback, (long)this) != 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -2324,23 +2324,34 @@ long TReport_book::print_section(TReport_section& rs) | |||||||
| 
 | 
 | ||||||
| bool TReport_book::init(TReport& rep) | bool TReport_book::init(TReport& rep) | ||||||
| { | { | ||||||
|  |   TPrinter& pr = printer(); | ||||||
|  | 
 | ||||||
|  |   bool save_profile = rep.save_last_printer(); | ||||||
|  |   if (save_profile && !pr.manual_setup()) | ||||||
|  |   { | ||||||
|  |     const TString profile = rep.filename().name(); | ||||||
|  |     TConfig prini(CONFIG_STAMPE, profile); | ||||||
|  |     const TString& rep_printer = prini.get("Name"); | ||||||
|  |     const TString& cur_printer = pr.printername(); | ||||||
|  |     if (rep_printer.full() && rep_printer != cur_printer)  | ||||||
|  |     { | ||||||
|  |       pr.read_configuration(profile); // Uso la stampante preferita dal report
 | ||||||
|  |       save_profile = false; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   // Controlla orientamento della carta prima di inizializzare
 |   // Controlla orientamento della carta prima di inizializzare
 | ||||||
|   const int report_orientation = rep.orientation(); |   const int report_orientation = rep.orientation(); | ||||||
|   if (report_orientation > 0) |   if (report_orientation > 0) | ||||||
|   { |   { | ||||||
|     PRINT_RCD* rcd = printer().get_printrcd(); |     pr.set_landscape_orientation(report_orientation == 2); | ||||||
|     if (xvt_print_is_valid(rcd)) |     // I parametri verranno riletti dalla TBook::init()
 | ||||||
|     { |   } | ||||||
|       long ph, pw, phr, pvr; | 
 | ||||||
|       xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, rcd, &ph, &pw, &phr, &pvr); |   if (save_profile)  | ||||||
|       const int priter_orientation = ph > pw ? 1 : 2; |   { | ||||||
|       if (report_orientation != priter_orientation) |     const TString profile = rep.filename().name(); | ||||||
|       { |     pr.save_configuration(profile); | ||||||
|         // Scambia orientamento della carta
 |  | ||||||
|         xvt_app_escape(XVT_ESC_SET_PRINTER_INFO, rcd, &pw, &ph, NULL, NULL); |  | ||||||
|         // I parametri verranno riletti dalla TBook::init()
 |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (!TBook::init()) |   if (!TBook::init()) | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ | |||||||
| #include <config.h> | #include <config.h> | ||||||
| #include <controls.h> | #include <controls.h> | ||||||
| #include <mask.h> | #include <mask.h> | ||||||
|  | #include <prefix.h> | ||||||
| #include <urldefid.h> | #include <urldefid.h> | ||||||
| #include <utility.h>      | #include <utility.h>      | ||||||
|   |   | ||||||
| @ -552,10 +553,18 @@ void xvtil_statbar_set( | |||||||
| {                     | {                     | ||||||
|   if (_statbar != NULL_WIN) |   if (_statbar != NULL_WIN) | ||||||
|   { |   { | ||||||
|     const TDate oggi(TODAY); |     TToken_string t(80, '\t'); | ||||||
|     TString256 t; |     t.add(text); | ||||||
|     t << text << '\t' << oggi.string() << " - " << main_app().title(); |     if (prefix_valid() && main_app().get_firm() > 0) | ||||||
| 
 |     { | ||||||
|  |       t.add(prefix().firm().get("RAGSOC")); | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |       const TDate oggi(TODAY); | ||||||
|  |       t.add(oggi.string()); | ||||||
|  |     } | ||||||
|  |     t.add(main_app().title()); | ||||||
|     if (def)                                           |     if (def)                                           | ||||||
|       statbar_set_default_title(_statbar, t); |       statbar_set_default_title(_statbar, t); | ||||||
|     statbar_set_title(_statbar, t); |     statbar_set_title(_statbar, t); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user