Files correlati : ca?.exe Ricompilazione Demo : [ ] Commento : Aggiunto supporto per la creazione di campi analitici dinamicamente sulle pagine successive alla prima git-svn-id: svn://10.65.10.50/trunk@12965 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			81 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #include <applicat.h>
 | |
| #include <reprint.h>
 | |
| 
 | |
| #include "ca1.h"
 | |
| #include "ca1500a.h"
 | |
| #include "calib01.h"
 | |
| #include "calib02.h"
 | |
| 
 | |
| class TMask_print_cdc : public TAutomask
 | |
| {
 | |
| 
 | |
| protected:
 | |
|   bool on_field_event(TOperable_field& o, TField_event e, long jolly) {return true;}
 | |
| public:
 | |
|   TMask_print_cdc();
 | |
|   virtual ~TMask_print_cdc() {}
 | |
| };
 | |
| 
 | |
| TMask_print_cdc::TMask_print_cdc()
 | |
| 							  :TAutomask("ca1500a")
 | |
| {
 | |
| 	ca_create_fields(*this, 0, LF_CDC, 3, 2, F_DACDC, F_DACDC + 100, 0x0, "#DACDC");
 | |
| 	int nfields = ca_create_fields(*this, 0, LF_CDC, 3, 8, F_ACDC, F_ACDC + 100, 0x0, "#ACDC");
 | |
| 	for (int i = 0; i < nfields; i++)
 | |
| 	{
 | |
| 		TMask_field& dacdc = field(F_DACDC + i);
 | |
| 		dacdc.set_group(1);
 | |
|     dacdc.check_type(CHECK_NORMAL);
 | |
| 		TMask_field& acdc = field(F_ACDC + i);
 | |
| 		acdc.set_group(2);
 | |
|     acdc.check_type(CHECK_NORMAL);
 | |
| 		field(F_DACDC + i).set_group(1);
 | |
| 		field(F_ACDC + i).set_group(2);
 | |
| 	}
 | |
| }
 | |
| 
 | |
| class TPrint_cdc : public TSkeleton_application
 | |
| {
 | |
| 	bool create();
 | |
| 
 | |
| public:
 | |
|   virtual void main_loop();
 | |
| };
 | |
| 
 | |
| bool TPrint_cdc::create()
 | |
| {
 | |
|   const TMultilevel_code_info& mci = ca_multilevel_code_info(LF_CDC);
 | |
|   if (mci.levels() <= 0)
 | |
| 	  return error_box(TR("I centri di costo non sono stati configurati"));
 | |
| 
 | |
|   return TSkeleton_application::create();
 | |
| }
 | |
| 
 | |
| void TPrint_cdc::main_loop()
 | |
| {
 | |
|   TFilename path;
 | |
|   TMask_print_cdc m;
 | |
|   while (m.run() == K_ENTER)
 | |
|   {
 | |
|     TReport_book book;
 | |
|     TAnal_report rep;
 | |
| 
 | |
| 		path = m.get(F_REPORT);
 | |
| 		if (path.empty())
 | |
| 			path = "ca1500a";
 | |
| 
 | |
| 		rep.load(path);
 | |
| 		rep.mask2report(m);
 | |
| 		book.add(rep);
 | |
|     book.print_or_preview();
 | |
|   }
 | |
| }
 | |
| 
 | |
| int ca1500(int argc, char* argv[])
 | |
| {
 | |
|   TPrint_cdc a;
 | |
|   a.run(argc, argv, TR("Stampa centri di costo"));
 | |
|   return 0;
 | |
| }
 | |
| 
 |