source: tags/1.5.0/Forms/UFormAbout.pas

Last change on this file was 174, checked in by chronos, 6 years ago
  • Added: Basic color theming support. Colors can be changed only for some controls.
File size: 1.6 KB
Line 
1unit UFormAbout;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
9 StdCtrls, ExtCtrls, UApplicationInfo, UCommon, LCLIntf;
10
11type
12
13 { TFormAbout }
14
15 TFormAbout = class(TForm)
16 ButtonHomePage: TButton;
17 ButtonClose: TButton;
18 Image1: TImage;
19 LabelAppName: TLabel;
20 LabelDescription: TLabel;
21 LabelContent: TLabel;
22 Panel1: TPanel;
23 procedure ButtonHomePageClick(Sender: TObject);
24 procedure FormCreate(Sender: TObject);
25 procedure FormShow(Sender: TObject);
26 private
27 { private declarations }
28 public
29 ApplicationInfo: TApplicationInfo;
30 end;
31
32var
33 FormAbout: TFormAbout;
34
35implementation
36
37{$R *.lfm}
38
39uses
40 UCore;
41
42resourcestring
43 SVersion = 'Version';
44 SReleaseDate = 'Release date';
45 SLicense = 'License';
46
47{ TFormAbout }
48
49procedure TFormAbout.FormShow(Sender: TObject);
50begin
51 if Assigned(ApplicationInfo) then begin
52 LabelAppName.Caption := ApplicationInfo.AppName;
53 LabelDescription.Caption := ApplicationInfo.Description;
54 LabelDescription.AutoSize := True;
55 LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
56 SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
57 SLicense + ': ' + ApplicationInfo.License;
58 Image1.Picture.Bitmap.Assign(Application.Icon);
59 end;
60end;
61
62procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
63begin
64 if Assigned(ApplicationInfo) then
65 OpenURL(ApplicationInfo.HomePage);
66end;
67
68procedure TFormAbout.FormCreate(Sender: TObject);
69begin
70 Core.CoolTranslator1.TranslateComponentRecursive(Self);
71 Core.ThemeManager.UseTheme(Self);
72end;
73
74end.
75
Note: See TracBrowser for help on using the repository browser.