source: trunk/Packages/Common/Forms/FormAbout.pas

Last change on this file was 219, checked in by chronos, 5 days ago
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
File size: 1.7 KB
Line 
1unit FormAbout;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
7 StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx;
8
9type
10 { TFormAbout }
11
12 TFormAbout = class(TFormEx)
13 ButtonClose: TButton;
14 ButtonHomePage: TButton;
15 ImageLogo: TImage;
16 LabelAppName: TLabel;
17 LabelDescription: TLabel;
18 LabelContent: TLabel;
19 PanelTop: TPanel;
20 PanelButtons: TPanel;
21 procedure ButtonHomePageClick(Sender: TObject);
22 procedure FormShow(Sender: TObject);
23 private
24 FApplicationInfo: TApplicationInfo;
25 public
26 procedure UpdateInterface;
27 property ApplicationInfo: TApplicationInfo read FApplicationInfo write
28 FApplicationInfo;
29 end;
30
31
32implementation
33
34{$R *.lfm}
35
36resourcestring
37 SVersion = 'Version';
38 SReleaseDate = 'Release date';
39 SLicense = 'License';
40 // TODO: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41095
41 {$hints off}
42 SHomePage = 'Home page';
43 SClose = 'Close';
44
45{ TFormAbout }
46
47procedure TFormAbout.FormShow(Sender: TObject);
48begin
49 if Assigned(ApplicationInfo) then
50 with ApplicationInfo do begin
51 LabelAppName.Caption := AppName;
52 LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
53 SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
54 SLicense + ': ' + License;
55 LabelDescription.Caption := Description;
56 ImageLogo.Picture.Bitmap.Assign(Icon);
57 end;
58 UpdateInterface;
59end;
60
61procedure TFormAbout.UpdateInterface;
62begin
63 ButtonHomePage.Enabled := Assigned(ApplicationInfo);
64end;
65
66procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
67begin
68 OpenWebPage(ApplicationInfo.HomePage);
69end;
70
71end.
Note: See TracBrowser for help on using the repository browser.