> {
throw Exception ("Помилка: Форма {" + t_desc-> formname + "} відсутня");
}
} __ finally
{
delete mrT;
}
}
// --------------------------------------------- ------------------------------
__fastcall TfrmUniForm :: TfrmUniForm (TComponent * Owner, TMenuItem * itm, AnsiString formname)
: TForm (Owner)
{
this-> itm = itm;
uid = "";
link = false;
desc = new TformDescription ();
slv = NULL; lnk = NULL;
desc-> formname = formname;
form-> dsc = desc;
parentform = NULL;
if (itm) itm-> Enabled = false;
accept = false;
btnlst = new TList ();
fltlst = new TList ();
fldlst = new TList ();
UploadInfo ();
}
// --------------------------------------------- ------------------------------
void __ fastcall TfrmUniForm :: UploadInfo ()
{
UploadMetaInfo (desc, desc-> formname);
this-> Caption = desc-> title;
form-> editpanel-> Caption = desc-> edittitle;
form-> dbgBrowse-> Columns-> Items [0] -> FieldName = Desc-> listfield;
form-> dbgBrowse-> Columns-> Items [0] -> Title-> Caption = "Назва";
if (desc-> readonly) { form-> tblBrowse-> ReadOnly = true;}
}
// --------------------------------------------- ------------------------------
void __ fastcall TfrmUniForm :: ReorderFilters ()
{
for (int r = 0; r Count; r + +)
{
TfrmFilter * fr = ((TfrmFilter *) ((TfltAddInfo *) fltlst-> Items [r]) -> pntr);
fr-> Align = alNone;
fr-> Visible = false;
}
for (int r = 0; r Count; r + +)
{
TfrmFilter * fr = ((TfrmFilter *) ((TfltAddInfo *) fltlst-> Items [r]) -> pntr);
fr-> Visible = true;
fr-> Align = alTop;
}
}
// --------------------------------------------- ------------------------------
void __ fastcall TfrmUniForm :: Execute ()
{
if (link)
{
form-> Go ();
// запам'ятаємо мета-інформацію по полях
int cnt = form-> tblBrowse-> Fields-> Count;
TField ** flms = new TField * [cnt];
for (int i = 0; i
{
TFieldType dtype = form-> tblBrowse-> Fields-> Fields [i] -> DataType;
if (dtype == ftInteger) flms [i] = new TIntegerField (this);
if (dtype == ftString) flms [i] = new TStringField (this);
if (dtype == ftFloat) flms [i] = new TFloatField (this);
if (dtype == ftDate) flms [i] = new TDateField (this);
if (dtype == ftDateTime) flms [i] = new TDateTimeField (this);
if (dtype == ftTime) flms [i] = new TTimeField (this);
flms [i] -> Required = form-> tblBro...