?? 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 + -