Modificato il meccanismo di autopremimento

git-svn-id: svn://10.65.10.50/trunk@2808 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-05-14 10:09:58 +00:00
parent ed910352f2
commit 39e455265a
2 changed files with 11 additions and 5 deletions

View File

@ -44,6 +44,7 @@ void TMask::init_mask()
_error_severity = 0; _error_severity = 0;
_test_fld = -1; _test_fld = -1;
_last_test = -1;
memset(_pagewin, 0, sizeof(_pagewin)); memset(_pagewin, 0, sizeof(_pagewin));
} }
@ -366,6 +367,7 @@ void TMask::start_run()
} }
_init_time = clock()-start; _init_time = clock()-start;
_last_test = -1;
} }
bool TMask::check_fields() bool TMask::check_fields()
@ -883,12 +885,12 @@ void TMask::set(
// @syntax set(short fld_id, long n, bool hit); // @syntax set(short fld_id, long n, bool hit);
{ {
TMask_field& f = field(fld_id); TMask_field& f = field(fld_id);
f.set(s); f.set(s);
if (hit && (f.active() || f.ghost())) if (hit && (f.active() || f.ghost()))
{ {
f.set_dirty(); f.set_dirty();
f.on_hit(); f.on_hit();
} }
} }
void TMask::set(short fld_id, long n, bool hit) void TMask::set(short fld_id, long n, bool hit)
@ -1180,14 +1182,16 @@ void TMask::on_idle()
_error_severity = 0; _error_severity = 0;
set_focus(); set_focus();
} }
if (_test_fld >= 0) if (_test_fld >= 0 && _last_test != _focus)
{ {
TEditable_field & e = (TEditable_field &) field(_test_fld); TEditable_field & e = (TEditable_field &) field(_test_fld);
if (!fld(_focus).in_key(e.first_key())) const TEditable_field & c = (TEditable_field &) fld(_focus);
if (!c.has_a_common_key(e))
{ {
e.test_key_complete(FALSE); e.test_key_complete(FALSE);
_test_fld = -1; _test_fld = -1;
} }
_last_test = _focus;
} }
} }
} }

View File

@ -99,6 +99,8 @@ class TMask : public TWindow
// @cmember:(INTERNAL) identificatore del campo da testare per l'autopremimento // @cmember:(INTERNAL) identificatore del campo da testare per l'autopremimento
short _test_fld; short _test_fld;
// @cmember:(INTERNAL) posizione del campo che per ultimo ha testato l'autopremimento
int _last_test;
// @access Protected Member // @access Protected Member
protected: protected: