Если имя поля оказалось не
UpdateFieldTypesN(FDbInterface, TypesComboBox, wTFbTypeGroup);
SetTypeGroupLayout(wTFbTypeGroup);
FpTFbCommonType := nil; // с этого начинаем конкретную работу
end;
Procedure TFldDlgFr.FormCreate(Sender: TObject);
Var
k : Integer;
begin
for k:=0 to ComponentCount-1 do
if TComponent(Components[k]) is TEdit then
TEdit(Components[k]).Clear;
TypesComboBox.Text := '';
FldSizeEdit.Text := '10';
end;
Procedure TFldDlgFr.CancelBtnClick(Sender: TObject);
begin
FModalRes := False;
Close;
end;
Procedure TFldDlgFr.FormActivate(Sender: TObject);
Var
k, i : Integer;
wpTTableInfo : pTTableInfo;
wspTFieldInfo : pTFieldInfo;
wpTFbCommonType : pTFbCommonType;
wTFbTypeGroup : TFbTypeGroup;
wCaptionUnique : Boolean;
wFieldDescr : String;
begin
if FDbInterface = nil then
begin
FbKernelWarning('FDbInterface = nil');
Exit;
end;
if TypesComboBox.Text = '' then
TypesComboBox.Text := 'Тип данных';
if FDbInterface.N_pTFieldInfo = nil then
Exit;
{ В дальнейшем все действия - только с FpTFbCommonType }
FldNameEdit.Text := FDbInterface.N_pTFieldInfo.sFieldAttr.Values['sFieldName'];
if TrimF(FldNameEdit.Text) <> '' then
begin
FldDescrEdit.Text := FDbInterface.N_pTFieldInfo.sFieldAttr.Values['sFieldDescr'];
FldCaptionEdit.Text := FDbInterface.N_pTFieldInfo.sFieldAttr.Values['sFieldCaption'];
FldSizeEdit.Text := IntToStr(FDbInterface.N_pTFieldInfo.sFieldSize);
end
else
// Если имя поля оказалось не заданным - предлагаем его
begin
if TbDefFr = nil then
FldNameEdit.Text := FDbInterface.Get_UniqueFieldName(
FDbInterface.Current_pTTableInfo, nil, wCaptionUnique, wFieldDescr)
else
FldNameEdit.Text := FDbInterface.Get_UniqueFieldName(
FDbInterface.Current_pTTableInfo, TbDefFr.TbFieldsListBox.Items,
wCaptionUnique, wFieldDescr);
if TrimF(FldCaptionEdit.Text) = '' then
FldCaptionEdit.Text := FldNameEdit.Text;
if TrimF(FldDescrEdit.Text) = '' then
FldDescrEdit.Text := wFieldDescr;
end;
{ Выставка индекса в ComboBox в соответствии с типом поля }
Содержание Назад Вперед