-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormAbout.pas
More file actions
101 lines (86 loc) · 2.83 KB
/
Copy pathFormAbout.pas
File metadata and controls
101 lines (86 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
unit FormAbout;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BaseFormCommon, StdCtrls, ExtCtrls, RzPanel, RzBmpBtn, pngimage, jpeg;
type
TfrmAbout = class(TfrmBaseCommon)
btnOk: TRzBmpButton;
imgLogo: TImage;
lblAppName: TLabel;
lblAppDescInfo: TLabel;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnOkClick(Sender: TObject);
private
{ Private declarations }
procedure SetBmpSmallButton(); //动态设置小型按钮
procedure LoadBmpSmallButtonResource();//加载BMP按钮图资源
procedure FreeBmpSmallButtonResource();//释放
public
{ Public declarations }
end;
var
frmAbout: TfrmAbout;
BmpDisabledS, BmpDownS, BmpOnS, BmpOutS: TBitmap;
implementation
uses FormMain, FunctionCommon, SystemConfig;
{$R *.dfm}
{ TfrmAbout }
procedure TfrmAbout.btnOkClick(Sender: TObject);
begin
inherited;
Close;
end;
{*******************************************************************************}
procedure TfrmAbout.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
FreeBmpSmallButtonResource;
end;
{*******************************************************************************}
procedure TfrmAbout.FormShow(Sender: TObject);
begin
inherited;
LoadBmpSmallButtonResource;
SetBmpSmallButton;
lblAppName.Caption:= GBL_SYS_APPNAME + ' v'
+ frmMain.VersionInfoMain.FileVersion + ' 版';
lblTitleBase.Caption:= '关于' + GBL_SYS_APPNAME;
end;
{*******************************************************************************}
procedure TfrmAbout.FreeBmpSmallButtonResource;
begin
FreeAndNil(BmpDisabledS);
FreeAndNil(BmpDownS);
FreeAndNil(BmpOnS);
FreeAndNil(BmpOutS);
end;
{*******************************************************************************}
procedure TfrmAbout.LoadBmpSmallButtonResource;
begin
if not Assigned(BmpDisabledS) then BmpDisabledS:= TBitmap.Create;
if not Assigned(BmpDownS) then BmpDownS:= TBitmap.Create;
if not Assigned(BmpOnS) then BmpOnS:= TBitmap.Create;
if not Assigned(BmpOutS) then BmpOutS:= TBitmap.Create;
try
BmpDisabledS.LoadFromResourceName(HInstance, 'btnDisabledS');
BmpDownS.LoadFromResourceName(HInstance, 'btnDownS');
BmpOnS.LoadFromResourceName(HInstance, 'btnOnS');
BmpOutS.LoadFromResourceName(HInstance, 'btnOutS');
except on E: Exception do begin
FunctionCommon.Log(E.Message);
end;
end;
end;
{*******************************************************************************}
procedure TfrmAbout.SetBmpSmallButton;
begin
btnOk.Bitmaps.Disabled:= BmpDisabledS;
btnOk.Bitmaps.Down:= BmpDownS;
btnOk.Bitmaps.StayDown:= BmpDownS;
btnOk.Bitmaps.Hot:= BmpOnS;
btnOk.Bitmaps.Up:= BmpOutS;
end;
{*******************************************************************************}
end.