Статьи Королевства Дельфи


L3_pas


unit F_TbDef;

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, Db, DBTables, ExtCtrls, Buttons, ComCtrls, DbItfT, DbItf, MnT;

Type

TTbDefFr = class (TForm)

TbFieldsListBox: TListBox;

NewFieldButton: TButton;

OkButton: TButton;

CancelButton: TButton;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Bevel1: TBevel;

Label10: TLabel;

TbNameLbl: TLabel;

procedure NewFieldButtonClick(Sender: TObject);

procedure CancelButtonClick(Sender: TObject);

procedure OkButtonClick(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure TbFieldsListBoxClick(Sender: TObject);

procedure FormActivate(Sender: TObject);

private

FModalRes : Boolean;

FpTTableInfo : pTTableInfo;

FDbInterface : TDbInterface;

FpTInfoCategory : pTInfoCategory;

procedure Set_FDbInterface(const Value: TDbInterface);

procedure Set_FpTInfoCategory(const Value: pTInfoCategory);

public

{ Public declarations }

Function Execute : Bool;

Property ppTTableInfo : pTTableInfo read FpTTableInfo write FpTTableInfo;

Property ppTInfoCategory : pTInfoCategory read FpTInfoCategory

write Set_FpTInfoCategory;

published

Property DbInterface : TDbInterface read FDbInterface write Set_FDbInterface;

end;

Var

TbDefFr: TTbDefFr;

implementation

uses

F_FldDlg;

{$R *.DFM}

procedure TTbDefFr.NewFieldButtonClick(Sender: TObject);

begin

if FldDlgFr = nil then

FldDlgFr := TFldDlgFr.Create(nil);

try

// Создаем новую структуру таблицы

FldDlgFr.DbInterface := FDbInterface;

FDbInterface.Init_NpTFieldInfo;

FDbInterface.Current_pTTableInfo := FDbInterface.N_pTTableInfo;

FldDlgFr.ShowModal;

if FldDlgFr.Execute then

begin { Структура заполнена успешно - сохранить ее }

TbFieldsListBox.Items.AddObject(

FDbInterface.N_pTFieldInfo.sFieldAttr.Values['sFieldCaption'],

Pointer(FDbInterface.N_pTFieldInfo));

FpTTableInfo.sFieldsL.Add(Pointer(FDbInterface.N_pTFieldInfo));




Начало  Назад  Вперед