generiche relative alle tabelle. git-svn-id: svn://10.65.10.50/trunk@2906 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			77 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #include <stdtypes.h>
 | |
| #include <tabutil.h>
 | |
| #include <execp.h>
 | |
| #include <utility.h>
 | |
| #include <tabapp.h>
 | |
| 
 | |
| void Tab_application::print()
 | |
| {
 | |
| #if XVT_OS == XVT_OS_WIN
 | |
|   TExternal_app stampa(format("ba3a -1 %s", (const char *) _tabname));
 | |
| #else
 | |
|   TExternal_app stampa(format("ba3 -1 %s", (const char *) _tabname));
 | |
| #endif
 | |
|   stampa.run();
 | |
| }
 | |
| 
 | |
| void Tab_application::init_query_mode(TMask& m) 
 | |
| {
 | |
|   m.enable(-GR_MODIFY_PROTECTED);
 | |
|   m.enable(-GR_RECORD_PROTECTED);
 | |
| }
 | |
| 
 | |
| void Tab_application::init_modify_mode(TMask& m) 
 | |
| {
 | |
|   m.disable(-GR_MODIFY_PROTECTED);
 | |
|   const bool enable = !(_rel->curr().get_bool(FPC));
 | |
| 
 | |
|   m.enable(-GR_RECORD_PROTECTED,enable);
 | |
| }
 | |
| 
 | |
| bool Tab_application::protected_record(TRectype& rec) 
 | |
| { 
 | |
|   return rec.get_bool(FPC);
 | |
| }
 | |
| 
 | |
| bool Tab_application::user_create()
 | |
| {
 | |
|   if (argc() < 3) 
 | |
|     return FALSE;
 | |
|   
 | |
|   _tabname = argv(2);
 | |
| 
 | |
|   if (_tabname.empty()) 
 | |
|     return FALSE;
 | |
|   
 | |
|   _tabname.upper();
 | |
|   TString16 m, t(_tabname);
 | |
| 
 | |
|   if (t[0] == '%') t.ltrim(1);
 | |
| 
 | |
|   m << "BATB" << t;
 | |
|   _msk = new TMask(m) ;
 | |
| 
 | |
|   for (int i = 0; i < _msk->fields(); i++)
 | |
|     if (_msk->fld(i).in_group(GR_SEARCH))
 | |
|     {
 | |
|       set_search_field(_msk->fld(i).dlg());
 | |
|       break;
 | |
|     }
 | |
| 
 | |
|   _rel = new TRelation(_tabname);
 | |
|   set_title(_msk->get_caption());
 | |
|   
 | |
|   TFilename rpt("batb"); rpt << t << ".rpt";
 | |
|   if (fexist(rpt)) enable_menu_item(M_FILE_PRINT);
 | |
| 
 | |
|   return TRUE;
 | |
| }
 | |
| 
 | |
| bool Tab_application::user_destroy() 
 | |
| {
 | |
|   if (_msk) delete  _msk;
 | |
|   if (_rel) delete  _rel;
 | |
|   return TRUE;
 | |
| }
 | |
| 
 |