source: tags/1.0.0/Forms/UFormAbout.pas

Last change on this file was 96, checked in by chronos, 6 years ago
  • Added: Theming support.
  • Modified: Items in Options dialog divided to two pages.
File size: 1.9 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, UCoolTranslator;
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 Translated: Boolean;
28 public
29 ApplicationInfo: TApplicationInfo;
30 CoolTranslator: TCoolTranslator;
31 end;
32
33var
34 FormAbout: TFormAbout;
35
36implementation
37
38{$R *.lfm}
39
40uses
41 UCore;
42
43resourcestring
44 SVersion = 'Version';
45 SReleaseDate = 'Release date';
46 SLicense = 'License';
47
48{ TFormAbout }
49
50procedure TFormAbout.FormShow(Sender: TObject);
51begin
52 if Assigned(CoolTranslator) and not Translated then begin
53 Translated := True;
54 CoolTranslator.TranslateComponentRecursive(Self);
55 end;
56 if Assigned(ApplicationInfo) then begin
57 LabelAppName.Caption := ApplicationInfo.AppName;
58 LabelAppName.AutoSize := True;
59 LabelAppName.Font.Size := 30;
60 LabelDescription.Caption := ApplicationInfo.Description;
61 LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
62 SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
63 SLicense + ': ' + ApplicationInfo.License;
64 Image1.Picture.Bitmap.Assign(Application.Icon);
65 end;
66end;
67
68procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
69begin
70 if Assigned(ApplicationInfo) then
71 OpenURL(ApplicationInfo.HomePage);
72end;
73
74procedure TFormAbout.FormCreate(Sender: TObject);
75begin
76 Core.ThemeManager.UseTheme(Self);
77 ApplicationInfo := nil;
78 CoolTranslator := nil;
79 Translated := False;
80end;
81
82end.
83
Note: See TracBrowser for help on using the repository browser.