Patch level : 2.2
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunta selezione report per classe invece che per libreria git-svn-id: svn://10.65.10.50/trunk@13233 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									4276d68742
								
							
						
					
					
						commit
						c52d20a09a
					
				@ -641,7 +641,7 @@ static bool get_xml_child(const TString& line, const char* tag, TString& value)
 | 
				
			|||||||
  return false;
 | 
					  return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool list_custom_files(const char* ext, const char* library, TString_array& files)
 | 
					bool list_custom_files(const char* ext, const char* classe, TString_array& files)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString_array lista;
 | 
					  TString_array lista;
 | 
				
			||||||
  TFilename path;
 | 
					  TFilename path;
 | 
				
			||||||
@ -664,7 +664,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
 | 
				
			|||||||
  list_files(path, lista);
 | 
					  list_files(path, lista);
 | 
				
			||||||
  sort_files(lista);           // Ordino i files e rimuovo i doppioni
 | 
					  sort_files(lista);           // Ordino i files e rimuovo i doppioni
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TToken_string libraries(50, ',');
 | 
					  TString8 acqua;
 | 
				
			||||||
  TString stringona, desc;
 | 
					  TString stringona, desc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FOR_EACH_ARRAY_ROW(lista, i, row)
 | 
					  FOR_EACH_ARRAY_ROW(lista, i, row)
 | 
				
			||||||
@ -678,17 +678,17 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
 | 
				
			|||||||
      for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe
 | 
					      for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe
 | 
				
			||||||
        stringona << scan.line();
 | 
					        stringona << scan.line();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
      get_xml_attr(stringona, "libraries", libraries);
 | 
					      get_xml_attr(stringona, "class", acqua);
 | 
				
			||||||
      if (library && *library)
 | 
					      if (classe && *classe)
 | 
				
			||||||
        ok = libraries.get_pos(library) >= 0;
 | 
					        ok = acqua == classe;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
      if (ok)
 | 
					      if (ok)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        get_xml_child(stringona, "description", desc);
 | 
					        get_xml_child(stringona, "description", desc);
 | 
				
			||||||
        TToken_string* riga = new TToken_string;
 | 
					        TToken_string* riga = new TToken_string;
 | 
				
			||||||
        riga->add(*row);
 | 
					        riga->add(*row);
 | 
				
			||||||
 | 
					        riga->add(acqua);
 | 
				
			||||||
        riga->add(desc);   
 | 
					        riga->add(desc);   
 | 
				
			||||||
        riga->add(libraries);
 | 
					 | 
				
			||||||
        files.add(riga);
 | 
					        files.add(riga);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -699,7 +699,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool select_custom_file(TFilename& path, const char* ext, const char* library)
 | 
					bool select_custom_file(TFilename& path, const char* ext, const char* library)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@20|Descrizione@50|Librerie@20"));
 | 
					  TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@8|Classe@8|Descrizione@50"));
 | 
				
			||||||
  TString_array& files = sheet.rows_array();
 | 
					  TString_array& files = sheet.rows_array();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool ok = list_custom_files(ext, library, files);
 | 
					  bool ok = list_custom_files(ext, library, files);
 | 
				
			||||||
 | 
				
			|||||||
@ -1,11 +1,11 @@
 | 
				
			|||||||
#include <colors.h>
 | 
					#include <colors.h>
 | 
				
			||||||
#include <expr.h>
 | 
					#include <expr.h>
 | 
				
			||||||
#include <image.h>
 | 
					 | 
				
			||||||
#include <printer.h>
 | 
					#include <printer.h>
 | 
				
			||||||
#include <recarray.h>
 | 
					#include <recarray.h>
 | 
				
			||||||
#include <relation.h>
 | 
					#include <relation.h>
 | 
				
			||||||
#include <reprint.h>
 | 
					#include <reprint.h>
 | 
				
			||||||
#include <xml.h>
 | 
					#include <xml.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <anagr.h>
 | 
					#include <anagr.h>
 | 
				
			||||||
#include <comuni.h>
 | 
					#include <comuni.h>
 | 
				
			||||||
#include <nditte.h>
 | 
					#include <nditte.h>
 | 
				
			||||||
@ -2078,6 +2078,9 @@ bool TReport::load(const char* fname)
 | 
				
			|||||||
    if (desc != NULL)
 | 
					    if (desc != NULL)
 | 
				
			||||||
      desc->GetEnclosedText(_description);
 | 
					      desc->GetEnclosedText(_description);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    _class = xml.GetAttr("class");
 | 
				
			||||||
 | 
					    _command_line = xml.GetAttr("command");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Carico la query principale PRIMA delle sezioni che potrebbero collegarvicisi
 | 
					    // Carico la query principale PRIMA delle sezioni che potrebbero collegarvicisi
 | 
				
			||||||
    const TXmlItem* sql = xml.FindFirstChild("sql");
 | 
					    const TXmlItem* sql = xml.FindFirstChild("sql");
 | 
				
			||||||
    if (sql != NULL)
 | 
					    if (sql != NULL)
 | 
				
			||||||
@ -2126,6 +2129,8 @@ bool TReport::save(const char* fname) const
 | 
				
			|||||||
    TXmlItem xml;
 | 
					    TXmlItem xml;
 | 
				
			||||||
    xml.SetTag("report");
 | 
					    xml.SetTag("report");
 | 
				
			||||||
    xml.SetAttr("name", name);
 | 
					    xml.SetAttr("name", name);
 | 
				
			||||||
 | 
					    xml.SetAttr("class", _class);
 | 
				
			||||||
 | 
					    xml.SetAttr("command", _command_line);
 | 
				
			||||||
    xml.SetAttr("lpi", _lpi);
 | 
					    xml.SetAttr("lpi", _lpi);
 | 
				
			||||||
    if (!_description.blank())
 | 
					    if (!_description.blank())
 | 
				
			||||||
      xml.AddChild("description") << _description;
 | 
					      xml.AddChild("description") << _description;
 | 
				
			||||||
 | 
				
			|||||||
@ -440,7 +440,9 @@ class TReport : public TAlex_virtual_machine
 | 
				
			|||||||
  TString _description;
 | 
					  TString _description;
 | 
				
			||||||
  TReport_font _font, _print_font; // Font
 | 
					  TReport_font _font, _print_font; // Font
 | 
				
			||||||
  int _lpi;                        // Lines per inch
 | 
					  int _lpi;                        // Lines per inch
 | 
				
			||||||
  TToken_string _include;
 | 
					  TToken_string _include;          // ex: calib
 | 
				
			||||||
 | 
					  TString8 _class;                 // ex: ca3300a
 | 
				
			||||||
 | 
					  TString _command_line;           // ex: ca3 -2
 | 
				
			||||||
  TReport_script _prescript, _postscript;
 | 
					  TReport_script _prescript, _postscript;
 | 
				
			||||||
  TString_array _params;
 | 
					  TString_array _params;
 | 
				
			||||||
  TRecordset* _recordset;
 | 
					  TRecordset* _recordset;
 | 
				
			||||||
@ -492,6 +494,10 @@ public:
 | 
				
			|||||||
  bool use_printer_font() const { return _use_printer_font; }
 | 
					  bool use_printer_font() const { return _use_printer_font; }
 | 
				
			||||||
  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; }
 | 
				
			||||||
 | 
					  void set_class(const char* classe) { _class = classe; }
 | 
				
			||||||
 | 
					  const TString& command_line() const { return _command_line; }
 | 
				
			||||||
 | 
					  void set_command_line(const char* cmd) { _command_line = cmd; }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  void set_font(const TReport_font& f) { _font = f; }
 | 
					  void set_font(const TReport_font& f) { _font = f; }
 | 
				
			||||||
  void unmap_font();
 | 
					  void unmap_font();
 | 
				
			||||||
 | 
				
			|||||||
@ -243,7 +243,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
PNT TPrint_preview_window::log2dev(long lx, long ly) const
 | 
					PNT TPrint_preview_window::log2dev(long lx, long ly) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PNT pnt = { lx, ly };
 | 
					  PNT pnt = { short(lx), short(ly) };
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  const TPoint res = _book->page_res();
 | 
					  const TPoint res = _book->page_res();
 | 
				
			||||||
  if (res.x > 0 && res.y > 0) // Should always be true :-)
 | 
					  if (res.x > 0 && res.y > 0) // Should always be true :-)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user