fatto anche check nella do_output

git-svn-id: svn://10.65.10.50/trunk@3676 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-09-26 15:31:43 +00:00
parent ec4bf8d8e8
commit 0c3ca2f48b

View File

@ -1616,7 +1616,10 @@ void TList_sheet::do_output(CheckTime t)
const bool hit = f.get() != val; const bool hit = f.get() != val;
f.set(val); f.set(val);
if (field().dlg() != id && hit) if (field().dlg() != id && hit)
{
f.on_hit(); f.on_hit();
f.check();
}
} }
} }
} }
@ -1736,6 +1739,7 @@ void TBrowse::parse_output(TScanner& scanner)
_out_id.add(s); _out_id.add(s);
s = scanner.pop(); s = scanner.pop();
_out_fn.add(s); _out_fn.add(s);
_secondary = FALSE;
} }
@ -1795,7 +1799,7 @@ void TBrowse::parse_join(TScanner& scanner)
key = scanner.integer(); key = scanner.integer();
else scanner.push(); else scanner.push();
byte alias = 0; int alias = 0;
if (scanner.popkey() == "AL") if (scanner.popkey() == "AL")
alias = scanner.integer(); alias = scanner.integer();
else scanner.push(); else scanner.push();
@ -1815,7 +1819,7 @@ void TBrowse::parse_join(TScanner& scanner)
#ifdef DBG #ifdef DBG
if (exp.empty()) yesnofatal_box("JOIN senza espressioni INTO"); if (exp.empty()) yesnofatal_box("JOIN senza espressioni INTO");
#endif #endif
if (isdigit(j[0])) if (isdigit(j[0]))
_relation->add(atoi(j), exp, key, to, alias); // join file _relation->add(atoi(j), exp, key, to, alias); // join file
else else
@ -1936,6 +1940,8 @@ int TBrowse::do_input(
if (!filter) return ne; if (!filter) return ne;
TString work(_filter.size()); TString work(_filter.size());
bool filter_update = FALSE;
for (int i = 0; _filter[i]; i++) for (int i = 0; _filter[i]; i++)
{ {
if (_filter[i] == '"') if (_filter[i] == '"')
@ -1955,10 +1961,15 @@ int TBrowse::do_input(
while (isdigit(_filter[i])) i++; while (isdigit(_filter[i])) i++;
i--; i--;
} }
else work << _filter[i]; else
{
work << _filter[i];
if (_filter[i] == '-' && _filter[i + 1] == '>')
filter_update = TRUE;
}
} }
_cursor->setfilter(work); _cursor->setfilter(work, filter_update);
_cursor->setregion(filtrec, filtrec); _cursor->setregion(filtrec, filtrec);
return ne; return ne;
@ -1996,22 +2007,35 @@ void TBrowse::do_output(CheckTime t)
sum << fld.read(*_cursor->relation()); sum << fld.read(*_cursor->relation());
} }
} }
const bool hit = f.get() != sum; const bool hit = f.get() != sum;
f.set(sum); f.set(sum);
if (field().dlg() != id && hit) if (field().dlg() != id && hit)
{
f.on_hit(); f.on_hit();
f.check();
}
} }
} }
} }
void TBrowse::do_clear() void TBrowse::do_clear()
{ {
for (TString16 fld = _out_id.get(0); fld.not_empty(); fld = _out_id.get()) for (TString16 fld = _out_id.get(0); fld.not_empty(); fld = _out_id.get())
{ {
const short id = field().atodlg(fld);
TMask_field& f = field(atoi(fld)); TMask_field& f = field(atoi(fld));
if (f.field() == NULL && _inp_id.get_pos(fld) < 0) if (f.field() == NULL && _inp_id.get_pos(fld) < 0)
{
const bool hit = f.get().not_empty();
f.reset(); f.reset();
if (field().dlg() != id && hit)
{
f.on_hit();
f.check();
}
}
} }
} }
@ -2074,10 +2098,10 @@ bool TBrowse::do_link(bool insert)
TString inp_id(i); TString inp_id(i);
TString16 field_name(_inp_fn.get()); TString16 field_name(_inp_fn.get());
TString s(field_name); TString s(field_name);
const int pos = s.find(","); const int pos = s.find(",");
if (pos >= 0) if (pos >= 0)
s.cut(pos); s.cut(pos);
s << "="; s << "=";
if (inp_id[0] == '"') if (inp_id[0] == '"')
@ -2444,12 +2468,12 @@ bool TEdit_field::parse_item(TScanner& scanner)
#endif #endif
int key = 1; int key = 1;
TRelation* r; TRelation* r = NULL;
const int logicnum = scanner.integer(); const int logicnum = scanner.integer();
TString16 tabmaskname; TString16 tabmaskname;
if (logicnum > 0) if (logicnum > 0)
r = new TRelation(logicnum); r = new TRelation(logicnum);
else else
{ {
@ -2480,15 +2504,15 @@ bool TEdit_field::parse_item(TScanner& scanner)
filter = (const char*)scanner.line(); filter = (const char*)scanner.line();
else else
scanner.push(); scanner.push();
_browse = new TBrowse(this, r, key, filter); _browse = new TBrowse(this, r, key, filter);
if (tabmaskname.not_empty()) if (tabmaskname.not_empty())
{ {
tabmaskname.insert("MBATB", 0); tabmaskname.insert("MBATB", 0);
browse()->set_insert(tabmaskname); browse()->set_insert(tabmaskname);
} }
_check_enabled = TRUE; _check_enabled = TRUE;
return TRUE; return TRUE;
} }
@ -2521,7 +2545,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
return yesnofatal_box("JOIN senza USE nel campo %d", dlg()); return yesnofatal_box("JOIN senza USE nel campo %d", dlg());
else else
#endif #endif
browse()->parse_join(scanner); browse()->parse_join(scanner);
return TRUE; return TRUE;
} }
@ -2792,11 +2816,17 @@ bool TEdit_field::on_key(KEY key)
browse()->check(); browse()->check();
} }
} }
} }
if (ok) if (ok)
ok = on_hit(); ok = on_hit();
else else
default_error_box(); {
if (empty())
ok = TRUE;
else
default_error_box();
}
if (ok) if (ok)
{ {
@ -3179,11 +3209,11 @@ bool TReal_field::parse_item(TScanner& scanner)
_decimals = _picture.len() - comma - 1; _decimals = _picture.len() - comma - 1;
} }
} }
#ifdef DBG //#ifdef DBG
if (_ctl_data._size > 9 && _ctl_data._size != 15) // if (_ctl_data._size > 9 && _ctl_data._size != 15)
::warning_box("Guy propone una dimensione di 15 per il campo %d: %s\nMa probabilmente ha toppato ...", // ::warning_box("Guy propone una dimensione di %d per il campo %d: %s\nMa probabilmente ha toppato ...",
_ctl_data._dlg, (const char*)_ctl_data._prompt); // preferred_size, _ctl_data._dlg, (const char*)_ctl_data._prompt);
#endif //#endif
return TRUE; return TRUE;
} }