[21] | 1 | unit FormAbout;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
|
---|
| 7 | StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx;
|
---|
| 8 |
|
---|
| 9 | type
|
---|
| 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 |
|
---|
| 32 | implementation
|
---|
| 33 |
|
---|
| 34 | {$R *.lfm}
|
---|
| 35 |
|
---|
| 36 | resourcestring
|
---|
| 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 |
|
---|
| 47 | procedure TFormAbout.FormShow(Sender: TObject);
|
---|
| 48 | begin
|
---|
| 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;
|
---|
| 59 | end;
|
---|
| 60 |
|
---|
| 61 | procedure TFormAbout.UpdateInterface;
|
---|
| 62 | begin
|
---|
| 63 | ButtonHomePage.Enabled := Assigned(ApplicationInfo);
|
---|
| 64 | end;
|
---|
| 65 |
|
---|
| 66 | procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
|
---|
| 67 | begin
|
---|
| 68 | OpenWebPage(ApplicationInfo.HomePage);
|
---|
| 69 | end;
|
---|
| 70 |
|
---|
| 71 | end.
|
---|