Aggiunto metodo per sapere quale sara' il campo che' prendera'
git-svn-id: svn://10.65.10.50/trunk@1187 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5ceac3fb47
								
							
						
					
					
						commit
						f51135451c
					
				| @ -25,6 +25,8 @@ bool TMask::test_focus_change(WINDOW next) | ||||
|   bool ok = TRUE; | ||||
|    | ||||
|   TMask_field& prev = fld(_focus);       | ||||
|   _next_fld = next == NULL_WIN ? DLG_NULL : fld(find_field_win(next)).dlg(); | ||||
|    | ||||
|   if (prev.win() != next) | ||||
|   {       | ||||
|     ok = prev.test_focus_change(); | ||||
| @ -441,6 +443,8 @@ void TMask::start_run() | ||||
|   load_checks(); | ||||
| 
 | ||||
|   const int max = fields();   | ||||
|    | ||||
|   _next_fld = DLG_NULL; | ||||
|   for (int i = 0; i < max; i++) | ||||
|   { | ||||
|     TMask_field& f = fld(i); | ||||
| @ -673,8 +677,6 @@ void TMask::set_focus() | ||||
| // Move the focus to the next (+1) or previous(-1) valid control
 | ||||
| void TMask::move_focus_field(int d) | ||||
| { | ||||
|   if (!test_focus_change()) | ||||
|     return; | ||||
|    | ||||
|   TMask_field& f = fld(_focus);                            | ||||
|   if (f.class_id() == CLASS_RADIO_FIELD) | ||||
| @ -687,6 +689,10 @@ void TMask::move_focus_field(int d) | ||||
|   } | ||||
| 
 | ||||
|   const int focus = find_active_field(_focus+d, d); | ||||
| 
 | ||||
|   if (!test_focus_change(fld(focus).win())) | ||||
|     return; | ||||
| 
 | ||||
|   if (fld(focus).parent() == f.parent() || check_current_page()) | ||||
|     _focus = focus; | ||||
|    | ||||
| @ -732,7 +738,10 @@ bool TMask::stop_run(KEY key) | ||||
|     if (!ok) return FALSE; | ||||
|   } | ||||
|   if (is_running())           // Gestisce correttamenete le maschere chiuse
 | ||||
|   { | ||||
|     get_mask_fields(); | ||||
|     _next_fld = DLG_NULL; | ||||
|   } | ||||
| 
 | ||||
|   return TWindow::stop_run(key); | ||||
| } | ||||
|  | ||||
| @ -41,6 +41,7 @@ class TMask : public TWindow | ||||
|    | ||||
|   int _first_focus;             // First control to have focus
 | ||||
|   int _focus;                   // Control with focus      
 | ||||
|   int _next_fld;                // Control who is gaining the focus
 | ||||
|   int _sheets;                  // Number of sheets
 | ||||
| 
 | ||||
|   MASK_HANDLER _handler;        // User defined key handler
 | ||||
| @ -130,6 +131,7 @@ public: | ||||
|   virtual void activate(bool on = TRUE); | ||||
| 
 | ||||
|   int id2pos(short id) const;   | ||||
|   short next_fld() const { return _next_fld;} // id of the field who is gaining the focus DLG_NULL is not exists
 | ||||
|   TMask_field& fld(int i) const { return (TMask_field&)_field[i]; } // Ritorna il campo i-esimo della maschera
 | ||||
|   TMask_field& field(short id) const;   // field with given id
 | ||||
|   TEdit_field& efield(short id) const;  // edit-field with given id
 | ||||
|  | ||||
| @ -1637,7 +1637,7 @@ bool TBrowse::empty_check() | ||||
| 
 | ||||
| TEdit_field::TEdit_field(TMask* mask) | ||||
| : TMask_field(mask), _browse(NULL), _sheet(NULL), | ||||
|   _buttonwin(NULL_WIN), _check(CHECK_NONE), _check_enabled(TRUE), | ||||
|   _buttonwin(NULL_WIN), _check(CHECK_NONE), _check_enabled(FALSE), | ||||
|   _forced(FALSE) | ||||
| {} | ||||
| 
 | ||||
| @ -1770,6 +1770,7 @@ bool TEdit_field::parse_item(TScanner& scanner) | ||||
|       _browse->set_insert(tabmaskname); | ||||
|     } | ||||
| 
 | ||||
|     _check_enabled = TRUE; | ||||
|     return TRUE; | ||||
|   } | ||||
| 
 | ||||
| @ -1784,7 +1785,10 @@ bool TEdit_field::parse_item(TScanner& scanner) | ||||
|       _browse = new TBrowse(this, b->cursor()); | ||||
| 
 | ||||
|     if (_browse)  | ||||
|     { | ||||
|       _check_enabled = TRUE; | ||||
|       return _browse->parse_copy(what, *b); | ||||
|     } | ||||
| 
 | ||||
| #ifdef DBG | ||||
|     return yesnofatal_box("Impossibile COPY senza USE nel campo %d", dlg()); | ||||
| @ -1806,6 +1810,7 @@ bool TEdit_field::parse_item(TScanner& scanner) | ||||
|     if (_sheet) return yesnofatal_box("SHEET duplicato nel campo %d", dlg()); | ||||
| #endif | ||||
|     _sheet = new TList_sheet(this, _prompt, scanner.string());  | ||||
|     _check_enabled = TRUE; | ||||
|     return TRUE; | ||||
|   } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user