📄 baseframe.pas
字号:
unit BaseFrame;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TBaseFrameF = class(TFrame)
private
FCaption: string;
function GetModalResult: Integer;
procedure SetModalResult(const Value: Integer);
procedure SetCaption(const Value: string);
{ Private declarations }
public
function CanClose: Boolean; virtual;
procedure Close;
property ModalResult: Integer read GetModalResult write SetModalResult;
property Caption: string read FCaption write SetCaption;
end;
TBaseFrameClass = class of TBaseFrameF;
implementation
{$R *.DFM}
{ TBaseFrameF }
function TBaseFrameF.CanClose: Boolean;
begin
Result := True;
end;
procedure TBaseFrameF.Close;
begin
if GetParentForm(Self) <> nil then
GetParentForm(Self).Close;
end;
function TBaseFrameF.GetModalResult: Integer;
begin
if GetParentForm(Self) <> nil then
Result := GetParentForm(Self).ModalResult
else Result := mrNone;
end;
procedure TBaseFrameF.SetCaption(const Value: string);
begin
FCaption := Value;
if GetParentForm(Self) <> nil then
GetParentForm(Self).Caption := FCaption;
end;
procedure TBaseFrameF.SetModalResult(const Value: Integer);
begin
if GetParentForm(Self) <> nil then
GetParentForm(Self).ModalResult := Value;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -