Sistemate abilitazioni campi e salvataggio descrizioni
git-svn-id: svn://10.65.10.50/trunk@2526 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
221e5f2d52
commit
ae2cebfece
@ -213,7 +213,8 @@ void TRec_sheet::save()
|
|||||||
const int nfields = f1.items();
|
const int nfields = f1.items();
|
||||||
|
|
||||||
for (int i = 0; i < nfields; i++)
|
for (int i = 0; i < nfields; i++)
|
||||||
_descr->set(_rec->rec()->Fd[i].Name, f1.row(i).get(-2));
|
_descr->set(_rec->rec()->Fd[i].Name, f1.row(i).items() > 4 ?
|
||||||
|
f1.row(i).get(-2) : "");
|
||||||
delete _descr;
|
delete _descr;
|
||||||
_descr = new TConfig(_descfname, DESCPAR);
|
_descr = new TConfig(_descfname, DESCPAR);
|
||||||
}
|
}
|
||||||
@ -241,8 +242,26 @@ void TRec_sheet::edit()
|
|||||||
if (_descr)
|
if (_descr)
|
||||||
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
|
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
|
||||||
else
|
else
|
||||||
f1.row(i).add("");
|
f1.row(i).add("");
|
||||||
}
|
const TFieldtypes type = (TFieldtypes) f1.row(i).get_int(1);
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case _datefld :
|
||||||
|
case _wordfld :
|
||||||
|
case _charfld :
|
||||||
|
case _boolfld :
|
||||||
|
case _memofld:
|
||||||
|
f1.disable_cell(i, 2);
|
||||||
|
case _alfafld :
|
||||||
|
case _intfld :
|
||||||
|
case _longfld :
|
||||||
|
case _intzerofld :
|
||||||
|
case _longzerofld:
|
||||||
|
f1.disable_cell(i, 3);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
f2.set_notify(key_notify);
|
f2.set_notify(key_notify);
|
||||||
f2.set_append(FALSE);
|
f2.set_append(FALSE);
|
||||||
int nkeys = _rec->keys();
|
int nkeys = _rec->keys();
|
||||||
@ -260,7 +279,8 @@ void TRec_sheet::edit()
|
|||||||
{
|
{
|
||||||
TToken_string s(f1.row(i));
|
TToken_string s(f1.row(i));
|
||||||
|
|
||||||
s.destroy(-2);
|
if (s.items() > 4)
|
||||||
|
s.destroy(-2);
|
||||||
if (s.items() > 0)
|
if (s.items() > 0)
|
||||||
_rec->update_fielddef(nf++, s);
|
_rec->update_fielddef(nf++, s);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user