Patch level : 2003 578
Files correlati : ef0.exe Ricompilazione Demo : [ ] Commento : Correzioni necessarie per errori sul modulo effetti: GF20082 git-svn-id: svn://10.65.10.50/trunk@11431 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									c5aae552a6
								
							
						
					
					
						commit
						6bcb3fddc6
					
				| @ -733,19 +733,19 @@ void TApplication::run( | ||||
|    | ||||
|   if (sn < 0)   | ||||
|   { | ||||
|     error_box(TR("Probabilmente non e' stata inserita la chiave di protezione")); | ||||
|     error_box(TR("Probabilmente non e' inserita la chiave di protezione\noppure mancano i relativi driver.")); | ||||
|     return; | ||||
|   }   | ||||
|   if (!test_assistance_year()) | ||||
|   { | ||||
|     error_box(TR("Probabilmente e' necessario attivare il contratto di assistenza")); | ||||
|     error_box(TR("Probabilmente e' necessario attivare il contratto di assistenza per l'anno in corso")); | ||||
|     return; | ||||
|   } | ||||
| 
 | ||||
|   set_perms(); | ||||
| 
 | ||||
|   const TFixed_string mod(get_module_name()); | ||||
|   if (mod.empty()) | ||||
|   const char* mod = get_module_name(); | ||||
|   if (mod == NULL || *mod == '\0') | ||||
|     return; | ||||
| 
 | ||||
|   XVT_CONFIG cfg; | ||||
|  | ||||
| @ -327,7 +327,7 @@ bool TDongle::hardlock_login(bool test_all_keys) | ||||
|       { | ||||
|         _year_assist = data[0]; | ||||
|         _max_users = data[1]; | ||||
|         const long& giulio = (const long&)data[2]; | ||||
|         const long giulio = *((const long*)&data[2]); | ||||
|         const long yyyymmdd = _last_update.julian2date(giulio); | ||||
|         _last_update = yyyymmdd; | ||||
|       } | ||||
| @ -663,7 +663,7 @@ bool TDongle::burn_hardlock() | ||||
|       return error_box("On Line Assistance error."); | ||||
|     if (data[1] == 0 || data[1] >= 10000) | ||||
|       return error_box("Bad users number."); | ||||
|     const long& val = (const long&)data[2]; | ||||
|     const long val = *((const long*)&data[2]); | ||||
|     const long yyyymmdd = today.julian2date(val); | ||||
|     const TDate date(yyyymmdd); | ||||
|     if (date > today) | ||||
| @ -672,8 +672,8 @@ bool TDongle::burn_hardlock() | ||||
|    | ||||
|   data[0] = _year_assist; | ||||
|   data[1] = _max_users; | ||||
|   long& val = (long&)data[2]; | ||||
|   val = today.date2julian(); | ||||
|   long* val = (long*)&data[2]; | ||||
|   *val = today.date2julian(); | ||||
|   garble(data); | ||||
|   write_words(60, 4, data); | ||||
|   _last_update = today; | ||||
|  | ||||
| @ -3984,31 +3984,42 @@ bool TForm::validate(TForm_item &cf, TToken_string &s) | ||||
|     pagetype pt; | ||||
|     char sec; | ||||
|     TLocalisamfile *file; | ||||
|     TString f_code(s.get()); // prende il codice del file da leggere
 | ||||
|     if (atoi(f_code) != 0) file= new TLocalisamfile(atoi(f_code)); // se il codice è numerico allora è un file
 | ||||
|     else file= new TTable(f_code); // altrimenti è una tabella
 | ||||
|     const TString f_code(s.get()); // prende il codice del file da leggere
 | ||||
|     if (atoi(f_code) != 0)  | ||||
|       file= new TLocalisamfile(atoi(f_code)); // se il codice è numerico allora è un file
 | ||||
|     else  | ||||
|       file= new TTable(f_code); // altrimenti è una tabella
 | ||||
|     file->zero(); // vuota il record corrente del file
 | ||||
|     TToken_string in(s.get(), '!'); | ||||
|     for (i=0; i<in.items(); i++) | ||||
|     { // scansione sugli elementi dell'input
 | ||||
|       TString curr(in.get(i)); | ||||
|       poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
 | ||||
|       if (poseq== -1) | ||||
|       { | ||||
|         poseq= curr.find('='); | ||||
|         if (poseq != -1) posrv= poseq+1; | ||||
|       } | ||||
|       else | ||||
|         posrv= poseq+2; | ||||
|       TString fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
 | ||||
|       TString expr(curr.mid(posrv)); // preleva l'espressione di assegnamento alla destra dell'uguale
 | ||||
|       TExpression rval(expr, _strexpr); | ||||
|       const TString& curr = in.get(i); | ||||
|       poseq= curr.find('='); // divide la stringa corrente in lvalue e rvalue
 | ||||
|       posrv = poseq+1; | ||||
|       if (curr[posrv] == '=') | ||||
|         posrv++; | ||||
|        | ||||
|       const TString16 fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
 | ||||
|       TExpression rval(curr.mid(posrv), _strexpr); // preleva l'espressione di assegnamento alla destra dell'uguale
 | ||||
|       TString16 var; | ||||
|       for (j=0; j<rval.numvar(); j++) | ||||
|       { // scansione delle variabili dell'espressione di rvalue
 | ||||
|         TString var= rval.varname(j); | ||||
|         if (var[0]=='#') var.ltrim(1); // rimuove dalla stringa il primo carattere
 | ||||
|         TForm_item &fi= cf.find_field(var); | ||||
|         rval.setvar(j, fi.get()); // il valore corrente del campo viene settato nell'espressione
 | ||||
|         var = rval.varname(j); | ||||
|         const bool is_form_field = var[0]=='#' ||                             // #3  
 | ||||
|                                    (isdigit(var[0]) && var.find("->")<0) ||   // 3
 | ||||
|                                    (isalpha(var[0]) && var.find("->")>0);     // BO->3
 | ||||
|         if (is_form_field) // E' un campo del form
 | ||||
|         { | ||||
|           if (var[0] == '#') | ||||
|             var.ltrim(1); | ||||
|           TForm_item &fi= cf.find_field(var); | ||||
|           rval.setvar(j, fi.get()); // il valore corrente del campo viene settato nell'espressione
 | ||||
|         } | ||||
|         else // E' un campo della relazione
 | ||||
|         { | ||||
|           TFieldref fr(var, 0);                 // CODCF oppure 33->CODCF
 | ||||
|           rval.setvar(j, fr.read(*relation())); // il valore corrente del campo viene settato nell'espressione
 | ||||
|         } | ||||
|       } | ||||
|       file->put(fld, rval.as_string()); // scrive il risultato dell'espressione nel campo del file
 | ||||
|     } | ||||
|  | ||||
| @ -4865,6 +4865,7 @@ void TField_window::update() | ||||
|                     MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR); | ||||
|   } | ||||
|   xvt_dwin_clear(me, NORMAL_BACK_COLOR); | ||||
|   set_font(); | ||||
| } | ||||
| 
 | ||||
| TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field* owner)  | ||||
| @ -4873,7 +4874,6 @@ TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindo | ||||
|   if (owner) | ||||
|   { | ||||
|     create(x, y, dx, dy, "", WSF_HSCROLL | WSF_VSCROLL, W_PLAIN, parent); | ||||
|     set_font(); | ||||
|     activate(owner->enabled()); | ||||
|     if (owner->shown())  | ||||
|       open(); | ||||
|  | ||||
| @ -132,12 +132,13 @@ void TIndwin::update_bar() | ||||
|   // Rettangolo contenente l'intera barra
 | ||||
|   RCT r; get_bar_rct(r); | ||||
|   | ||||
|   RCT b = r; | ||||
|   const WINDOW w = win(); | ||||
|   set_font(); | ||||
|   if (ADVANCED_GRAPHICS) | ||||
|   { | ||||
|     const WINDOW w = win(); | ||||
|     RCT b = r; | ||||
|     // Rettangolo scavato
 | ||||
|     xi_draw_3d_rect((XinWindow)w, (XinRect*)&r, TRUE, 2,  | ||||
|     xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, TRUE, 2,  | ||||
|                     MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR); | ||||
|     b.left += 2; b.right -= 2; | ||||
|     b.top += 2; b.bottom -= 2;                | ||||
| @ -185,16 +186,17 @@ void TIndwin::update_bar() | ||||
|   else | ||||
|   { | ||||
|     // Rettangolo in rilievo
 | ||||
|     RCT b = r; | ||||
|     b.right = b.left + int((r.right-r.left)*prc); | ||||
|     xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, FALSE, 2,  | ||||
|     xi_draw_3d_rect((XinWindow)win(), (XinRect*)&b, FALSE, 2,  | ||||
|                     BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR); | ||||
|     // Rettangolo scavato
 | ||||
|     b.left = b.right; b.right = r.right; | ||||
|     xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, TRUE, 2,  | ||||
|     xi_draw_3d_rect((XinWindow)win(), (XinRect*)&b, TRUE, 2,  | ||||
|                     BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR); | ||||
| 
 | ||||
|     char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5)); | ||||
|     xvt_dwin_draw_text(w, r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1); | ||||
|     xvt_dwin_draw_text(win(), r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1); | ||||
|   } | ||||
| 
 | ||||
|   check_stop(); | ||||
|  | ||||
| @ -21,14 +21,19 @@ TRelation_application::TRelation_application() | ||||
| TRelation_application::~TRelation_application() | ||||
| { } | ||||
| 
 | ||||
| TCursor& TRelation_application::get_filtered_cursor() const | ||||
| { | ||||
|   TEdit_field& f = get_search_field(); | ||||
|   TCursor* cur = f.browse()->cursor(); | ||||
|   return *cur; | ||||
| } | ||||
| 
 | ||||
| void TRelation_application::setkey() | ||||
| { | ||||
|   if (has_filtered_cursor()) | ||||
|   { | ||||
|     TEdit_field& f = get_search_field(); | ||||
|     TCursor* cur = f.browse()->cursor(); | ||||
|     cur->setkey(); | ||||
|     return; | ||||
|     get_filtered_cursor().setkey(); | ||||
|     return;  // ?????
 | ||||
|   } | ||||
|   file().setkey(1); | ||||
| } | ||||
| @ -81,7 +86,6 @@ void TRelation_application::set_limits( | ||||
|   if (has_filtered_cursor()) | ||||
|   { | ||||
|     TEdit_field& f = get_search_field(); | ||||
|      | ||||
|     TBrowse* b = f.browse(); | ||||
|     TCursor* cur = b != NULL ? b->cursor() : NULL; | ||||
|     if (cur) | ||||
| @ -1387,11 +1391,31 @@ void TRelation_application::main_loop() | ||||
|             break; | ||||
|           case K_NEXT: | ||||
|             err = file().reread(); | ||||
|             err = file().next(_testandlock); | ||||
|             if (has_filtered_cursor()) | ||||
|             { | ||||
|               TCursor& cur = get_filtered_cursor(); | ||||
|               cur.curr() = file().curr(); | ||||
|               cur.read(); | ||||
|               ++cur; | ||||
|               file().curr() = cur.curr(); | ||||
|               err = get_relation()->read(_isequal, _testandlock); | ||||
|             } | ||||
|             else | ||||
|               err = file().next(_testandlock); | ||||
|             break; | ||||
|           case K_PREV: | ||||
|             err = file().reread(); | ||||
|             err = file().prev(_testandlock); | ||||
|             file().reread(); | ||||
|             if (has_filtered_cursor()) | ||||
|             { | ||||
|               TCursor& cur = get_filtered_cursor(); | ||||
|               cur.curr() = file().curr(); | ||||
|               cur.read(); | ||||
|               --cur; | ||||
|               file().curr() = cur.curr(); | ||||
|               err = get_relation()->read(_isequal, _testandlock); | ||||
|             } | ||||
|             else | ||||
|               err = file().prev(_testandlock); | ||||
|             break; | ||||
|           case K_END: | ||||
|             err = file().readat(_last, _testandlock); | ||||
|  | ||||
| @ -104,6 +104,7 @@ private: | ||||
|   // @cmember:(INTERNAL) Controlla se il <c TCursor> ha un filtro
 | ||||
|   virtual bool has_filtered_cursor() const  | ||||
|   { return filtered(); } | ||||
|   virtual TCursor& get_filtered_cursor() const; | ||||
| 
 | ||||
|   // @cmember:(INTERNAL) Sistema il bottone ricerca se necessario
 | ||||
| 	void set_find_button(); | ||||
|  | ||||
| @ -273,7 +273,7 @@ WINDOW cur_win() | ||||
| { | ||||
|   WINDOW win = NULL_WIN; | ||||
|   TWindow* w = WinManager.cur_win(); | ||||
|   if (w) | ||||
|   if (w != NULL) | ||||
|   {  | ||||
|     win = w->win(); | ||||
|     if (!is_valid_window(w->win())) | ||||
| @ -390,11 +390,13 @@ void TWindow::close() | ||||
| 
 | ||||
| void TWindow::close_modal() | ||||
| {             | ||||
|   CHECK(is_modal(), "Can't modal-close a non-modal window"); | ||||
|   WinManager.unreg(this); | ||||
|   close(); | ||||
|   _open = FALSE; | ||||
|   set_modal(FALSE); | ||||
|   if (is_modal()) | ||||
|   { | ||||
|     WinManager.unreg(this); | ||||
|     close(); | ||||
|     _open = FALSE; | ||||
|     set_modal(FALSE); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| bool TWindow::stop_run(KEY key) | ||||
| @ -437,7 +439,7 @@ KEY TWindow::run() | ||||
|   	xvt_sys_sleep(50); | ||||
| 	} | ||||
| 
 | ||||
|   if (!was_open && is_open())  | ||||
|   if (!was_open)  | ||||
|     close_modal(); | ||||
|   do_events(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user