Ignore:
Timestamp:
Jun 30, 2023, 10:01:24 PM (11 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
Location:
trunk/Packages/Common/Forms
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Forms/FormAbout.pas

    r161 r162  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    7   StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme;
     7  StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx;
    88
    99type
    1010  { TFormAbout }
    1111
    12   TFormAbout = class(TForm)
     12  TFormAbout = class(TFormEx)
    1313    ButtonClose: TButton;
    1414    ButtonHomePage: TButton;
     
    2121    procedure ButtonHomePageClick(Sender: TObject);
    2222    procedure FormShow(Sender: TObject);
     23  private
     24    FApplicationInfo: TApplicationInfo;
    2325  public
    24     AboutDialog: TObject; //TAboutDialog
    2526    procedure UpdateInterface;
     27    property ApplicationInfo: TApplicationInfo read FApplicationInfo write
     28      FApplicationInfo;
    2629  end;
    2730
     
    3033
    3134{$R *.lfm}
    32 
    33 uses
    34   AboutDialog;
    3535
    3636resourcestring
     
    4343procedure TFormAbout.FormShow(Sender: TObject);
    4444begin
    45   if Assigned(AboutDialog) then
    46   with TAboutDialog(AboutDialog) do begin
    47     if Assigned(Translator) then
    48       Translator.TranslateComponentRecursive(Self);
    49     if Assigned(ThemeManager) then
    50       ThemeManager.UseTheme(Self);
    51 
    52     if Assigned(ApplicationInfo) then
    53     with ApplicationInfo do begin
    54       LabelAppName.Caption := AppName;
    55       LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
    56         SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
    57         SLicense + ': ' + License;
    58       LabelDescription.Caption := Description;
    59       ImageLogo.Picture.Bitmap.Assign(Icon);
    60     end;
     45  if Assigned(ApplicationInfo) then
     46  with ApplicationInfo do begin
     47    LabelAppName.Caption := AppName;
     48    LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
     49      SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
     50      SLicense + ': ' + License;
     51    LabelDescription.Caption := Description;
     52    ImageLogo.Picture.Bitmap.Assign(Icon);
    6153  end;
    6254  UpdateInterface;
     
    6557procedure TFormAbout.UpdateInterface;
    6658begin
    67   ButtonHomePage.Enabled := Assigned(AboutDialog) and
    68     Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
     59  ButtonHomePage.Enabled := Assigned(ApplicationInfo);
    6960end;
    7061
    7162procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
    7263begin
    73   OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
     64  OpenWebPage(ApplicationInfo.HomePage);
    7465end;
    7566
Note: See TracChangeset for help on using the changeset viewer.