| 1 | unit UFormAbout;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
|
|---|
| 7 | StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 10 | { TFormAbout }
|
|---|
| 11 |
|
|---|
| 12 | TFormAbout = class(TForm)
|
|---|
| 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 FormCreate(Sender: TObject);
|
|---|
| 23 | procedure FormShow(Sender: TObject);
|
|---|
| 24 | private
|
|---|
| 25 | { private declarations }
|
|---|
| 26 | public
|
|---|
| 27 | AboutDialog: TObject; //TAboutDialog
|
|---|
| 28 | procedure UpdateInterface;
|
|---|
| 29 | end;
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | implementation
|
|---|
| 33 |
|
|---|
| 34 | {$R *.lfm}
|
|---|
| 35 |
|
|---|
| 36 | uses
|
|---|
| 37 | UAboutDialog;
|
|---|
| 38 |
|
|---|
| 39 | resourcestring
|
|---|
| 40 | SVersion = 'Version';
|
|---|
| 41 | SReleaseDate = 'Release date';
|
|---|
| 42 | SLicense = 'License';
|
|---|
| 43 |
|
|---|
| 44 | { TFormAbout }
|
|---|
| 45 |
|
|---|
| 46 | procedure TFormAbout.FormShow(Sender: TObject);
|
|---|
| 47 | begin
|
|---|
| 48 | if Assigned(AboutDialog) then
|
|---|
| 49 | with TAboutDialog(AboutDialog) do begin
|
|---|
| 50 | if Assigned(Translator) then
|
|---|
| 51 | Translator.TranslateComponentRecursive(Self);
|
|---|
| 52 | if Assigned(ThemeManager) then
|
|---|
| 53 | ThemeManager.UseTheme(Self);
|
|---|
| 54 |
|
|---|
| 55 | if Assigned(ApplicationInfo) then
|
|---|
| 56 | with ApplicationInfo do begin
|
|---|
| 57 | LabelAppName.Caption := AppName;
|
|---|
| 58 | LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
|
|---|
| 59 | SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
|
|---|
| 60 | SLicense + ': ' + License;
|
|---|
| 61 | LabelDescription.Caption := Description;
|
|---|
| 62 | ImageLogo.Picture.Bitmap.Assign(Icon);
|
|---|
| 63 | end;
|
|---|
| 64 | end;
|
|---|
| 65 | UpdateInterface;
|
|---|
| 66 | end;
|
|---|
| 67 |
|
|---|
| 68 | procedure TFormAbout.UpdateInterface;
|
|---|
| 69 | begin
|
|---|
| 70 | ButtonHomePage.Enabled := Assigned(AboutDialog) and
|
|---|
| 71 | Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
|
|---|
| 72 | end;
|
|---|
| 73 |
|
|---|
| 74 | procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
|
|---|
| 75 | begin
|
|---|
| 76 | OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
|
|---|
| 77 | end;
|
|---|
| 78 |
|
|---|
| 79 | procedure TFormAbout.FormCreate(Sender: TObject);
|
|---|
| 80 | begin
|
|---|
| 81 | end;
|
|---|
| 82 |
|
|---|
| 83 | end.
|
|---|
| 84 |
|
|---|