Leggero cambiamento del flag F dei maskfield

git-svn-id: svn://10.65.10.50/trunk@1002 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-02-15 08:53:41 +00:00
parent 148956c90c
commit 348530163b
2 changed files with 27 additions and 31 deletions

View File

@ -1183,10 +1183,11 @@ void TMask::on_firm_change()
for (int i = 0; i < fields(); i++) for (int i = 0; i < fields(); i++)
{ {
TMask_field& f = fld(i); TMask_field& f = fld(i);
if (f._flags.firm && f.get() != firm) if (f._flags.firm)
{ {
f.set(firm); f.set(firm);
f.on_key(K_TAB); // f.check(STARTING_CHECK); f.on_hit(); f.check(STARTING_CHECK);
f.on_hit();
} }
} }
} }

View File

@ -1,4 +1,4 @@
// $Id: maskfld.cpp,v 1.79 1995-02-13 17:21:17 guy Exp $ // $Id: maskfld.cpp,v 1.80 1995-02-15 08:53:41 guy Exp $
#include <xvt.h> #include <xvt.h>
#include <applicat.h> #include <applicat.h>
@ -512,7 +512,7 @@ HIDDEN void modify_list(bool add, TMask_field& f, TToken_string& msg)
#ifdef DBG #ifdef DBG
if (f.class_id() != CLASS_LIST_FIELD) if (f.class_id() != CLASS_LIST_FIELD)
{ {
error_box("Can't add/delete items of non list-box field %d", f.dlg()); yesnofatal_box("Can't add/delete items of non list-box field %d", f.dlg());
return; return;
} }
#endif #endif
@ -1446,7 +1446,7 @@ bool TBrowse::do_insert()
ok = _cursor->ok(); ok = _cursor->ok();
if (ok) do_output(); if (ok) do_output();
#ifdef DBG #ifdef DBG
else error_box("Selezione da programma esterno errata"); else yesnofatal_box("Selezione da programma esterno errata");
#endif #endif
} }
} }
@ -1713,7 +1713,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
{ {
#ifdef DBG #ifdef DBG
if (_browse != NULL) if (_browse != NULL)
return error_box("USE duplicata nel campo %d", dlg()); return yesnofatal_box("USE duplicata nel campo %d", dlg());
#endif #endif
int key = 1; int key = 1;
@ -1729,8 +1729,8 @@ bool TEdit_field::parse_item(TScanner& scanner)
tabmaskname = scanner.pop(); tabmaskname = scanner.pop();
#ifdef DBG #ifdef DBG
if (tabmaskname.len() > 4) if (tabmaskname.len() > 4)
return error_box("'%s' non e' una tabella valida: %d", return yesnofatal_box("'%s' non e' una tabella valida: %d",
(const char*)tabmaskname, dlg()); (const char*)tabmaskname, dlg());
#endif #endif
r = new TRelation(tabmaskname); r = new TRelation(tabmaskname);
} }
@ -1798,7 +1798,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (scanner.key() == "SH") // SHEET if (scanner.key() == "SH") // SHEET
{ {
#ifdef DBG #ifdef DBG
if (_sheet) return error_box("SHEET duplicato nel campo %d", dlg()); if (_sheet) return yesnofatal_box("SHEET duplicato nel campo %d", dlg());
#endif #endif
_sheet = new TList_sheet(this, _prompt, scanner.string()); _sheet = new TList_sheet(this, _prompt, scanner.string());
return TRUE; return TRUE;
@ -1807,7 +1807,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (scanner.key() == "IT") // ITEM if (scanner.key() == "IT") // ITEM
{ {
#ifdef DBG #ifdef DBG
if (_sheet == NULL) return error_box("ITEM senza SHEET nel campo %d", dlg()); if (_sheet == NULL) return yesnofatal_box("ITEM senza SHEET nel campo %d", dlg());
#endif #endif
_sheet->read_item(scanner); _sheet->read_item(scanner);
return TRUE; return TRUE;
@ -1818,7 +1818,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (_browse) _browse->parse_input(scanner); else if (_browse) _browse->parse_input(scanner); else
if (_sheet) _sheet->parse_input(scanner); if (_sheet) _sheet->parse_input(scanner);
#ifdef DBG #ifdef DBG
else error_box("INPUT senza USE o SHEET nel campo %d", dlg()); else yesnofatal_box("INPUT senza USE o SHEET nel campo %d", dlg());
#endif #endif
return TRUE; return TRUE;
} }
@ -1826,7 +1826,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (scanner.key() == "DI") if (scanner.key() == "DI")
{ {
#ifdef DBG #ifdef DBG
if(!_browse) return error_box("DISPLAY senza USE nel campo %d", dlg()); if(!_browse) return yesnofatal_box("DISPLAY senza USE nel campo %d", dlg());
#endif #endif
_browse->parse_display(scanner); _browse->parse_display(scanner);
return TRUE; return TRUE;
@ -1837,7 +1837,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (_browse) _browse->parse_output(scanner); if (_browse) _browse->parse_output(scanner);
else if (_sheet) _sheet->parse_output(scanner); else if (_sheet) _sheet->parse_output(scanner);
#ifdef DBG #ifdef DBG
else return error_box("OUTPUT senza USE nel campo %d", dlg()); else return yesnofatal_box("OUTPUT senza USE nel campo %d", dlg());
#endif #endif
return TRUE; return TRUE;
} }
@ -1845,7 +1845,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
if (scanner.key() == "AD") if (scanner.key() == "AD")
{ {
#ifdef DBG #ifdef DBG
if(!_browse) return error_box("ADD senza USE nel campo %d", dlg()); if(!_browse) return yesnofatal_box("ADD senza USE nel campo %d", dlg());
#endif #endif
_browse->parse_insert(scanner); _browse->parse_insert(scanner);
return TRUE; return TRUE;
@ -1862,8 +1862,8 @@ bool TEdit_field::parse_item(TScanner& scanner)
const int _nparms = scanner.integer(); const int _nparms = scanner.integer();
#ifdef DBG #ifdef DBG
if (_nparms < 0) if (_nparms < 0 || _nparms > 100)
return yesnofatal_box("Numero di parametri VALIDATE errato nel campo %d", dlg()); return yesnofatal_box("Numero di parametri VALIDATE errato nel campo %d: %d", dlg(), _nparms);
#endif #endif
for(int i = 0; i < _nparms; i++) for(int i = 0; i < _nparms; i++)
@ -2067,18 +2067,13 @@ bool TEdit_field::on_key(KEY key)
if (_sheet) ok = query || _sheet->check(); // Check consistency if (_sheet) ok = query || _sheet->check(); // Check consistency
else else
if (_browse && if (_browse && check_enabled() && (!query || forced()) && _validate_func != 21)
check_enabled() &&
(!query || forced()) &&
_validate_func != 21) // 21 = NOT_EMPTY_CHECK_FIELD
ok = _browse->check(); ok = _browse->check();
if (!ok) if (!ok) return default_error_box();
return default_error_box();
ok = on_hit(); ok = on_hit();
if (!ok) if (!ok) return FALSE;
return FALSE;
if (query && required() && in_key(0)) if (query && required() && in_key(0))
{ {
@ -2115,8 +2110,8 @@ bool TEdit_field::on_key(KEY key)
if (_sheet) ok = query || _sheet->check(FINAL_CHECK); if (_sheet) ok = query || _sheet->check(FINAL_CHECK);
else else
if (_browse && if (_browse &&
check_enabled() && check_enabled() &&
_validate_func != 21 && _validate_func != 21 && // 21 = NOT_EMPTY_CHECK_FIELD
(!query || forced())) (!query || forced()))
{ {
if (dirty()) ok = _browse->check(FINAL_CHECK); // Check consistency if (dirty()) ok = _browse->check(FINAL_CHECK); // Check consistency
@ -2169,13 +2164,14 @@ bool TEdit_field::has_check() const
} }
bool TEdit_field::check(CheckTime t) bool TEdit_field::check(CheckTime t)
{ {
bool ok = TRUE;
if (check_enabled() || (t == STARTING_CHECK && shown())) if (check_enabled() || (t == STARTING_CHECK && shown()))
{ {
if (_browse) return _browse->check(t); else if (_browse) ok = (_validate_func == 21) || _browse->check(t);
if (_sheet) return _sheet->check(t); else if (_sheet) ok = _sheet->check(t);
} }
return TRUE; return ok;
} }
void TEdit_field::enable_check(bool on) void TEdit_field::enable_check(bool on)
@ -2502,7 +2498,6 @@ bool TDate_field::on_key(KEY key)
TDate d(data); TDate d(data);
if (!d.ok()) if (!d.ok())
{ {
// error_box("La data deve essere nel formato gg-mm-aaaa");
error_box("Data errata o formato non valido"); error_box("Data errata o formato non valido");
return FALSE; return FALSE;
} }