source: trunk/Packages/Common/UFormAbout.pas

Last change on this file was 1, checked in by chronos, 3 years ago
  • Added: "Clovece nezlob se" game with adjustable board for different player count.
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, UTranslator, UTheme;
10
11type
12 { TFormAbout }
13
14 TFormAbout = class(TForm)
15 ButtonClose: TButton;
16 ButtonHomePage: TButton;
17 ImageLogo: TImage;
18 LabelAppName: TLabel;
19 LabelDescription: TLabel;
20 LabelContent: TLabel;
21 PanelTop: TPanel;
22 PanelButtons: TPanel;
23 procedure ButtonHomePageClick(Sender: TObject);
24 procedure FormCreate(Sender: TObject);
25 procedure FormShow(Sender: TObject);
26 private
27 { private declarations }
28 public
29 AboutDialog: TObject; //TAboutDialog
30 procedure UpdateInterface;
31 end;
32
33
34implementation
35
36{$R *.lfm}
37
38uses
39 UAboutDialog;
40
41resourcestring
42 SVersion = 'Version';
43 SReleaseDate = 'Release date';
44 SLicense = 'License';
45
46{ TFormAbout }
47
48procedure TFormAbout.FormShow(Sender: TObject);
49begin
50 if Assigned(AboutDialog) then
51 with TAboutDialog(AboutDialog) do begin
52 if Assigned(CoolTranslator) then
53 CoolTranslator.TranslateComponentRecursive(Self);
54 if Assigned(ThemeManager) then
55 ThemeManager.UseTheme(Self);
56
57 if Assigned(ApplicationInfo) then
58 with ApplicationInfo do begin
59 LabelAppName.Caption := AppName;
60 LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
61 SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
62 SLicense + ': ' + License;
63 LabelDescription.Caption := Description;
64 ImageLogo.Picture.Bitmap.Assign(Icon);
65 end;
66 end;
67 UpdateInterface;
68end;
69
70procedure TFormAbout.UpdateInterface;
71begin
72 ButtonHomePage.Enabled := Assigned(AboutDialog) and
73 Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
74end;
75
76procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
77begin
78 OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
79end;
80
81procedure TFormAbout.FormCreate(Sender: TObject);
82begin
83end;
84
85end.
86
Note: See TracBrowser for help on using the repository browser.