flibprops.pas

来自「FlexGraphics是一套创建矢量图形的VCL组件」· PAS 代码 · 共 59 行

PAS
59
字号
unit fLibProps;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, Mask, ToolEdit, ExtCtrls, FlexLibs;

type
  TfmLibProps = class(TForm)
    bbOk: TBitBtn;
    bbCancel: TBitBtn;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    edTitle: TEdit;
    Label3: TLabel;
    mmDesc: TMemo;
    fedLibFilename: TFilenameEdit;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    FFlexLibrary: TFlexLibrary;
    procedure SetFlexLibrary(const Value: TFlexLibrary);
  public
    { Public declarations }
    property  FlexLibrary: TFlexLibrary read FFlexLibrary write SetFlexLibrary;
  end;

var
  fmLibProps: TfmLibProps;

implementation

{$R *.DFM}

procedure TfmLibProps.SetFlexLibrary(const Value: TFlexLibrary);
begin
 if Value = FFlexLibrary then exit;
 FFlexLibrary := Value;
 if Assigned(FFlexLibrary) then begin
  fedLibFilename.Text := FFlexLibrary.LibFilename;
  edTitle.Text := FFlexLibrary.Name;
  mmDesc.Lines.Text := FFlexLibrary.Hint;
 end;
end;

procedure TfmLibProps.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 if ModalResult = mrOk then begin
  FFlexLibrary.LibFilename := fedLibFilename.Text;
  FFlexLibrary.Name := edTitle.Text;
  FFlexLibrary.Hint := mmDesc.Lines.Text;
  FFlexLibrary.Modified := true;
 end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?