Ignore:
Timestamp:
Jun 7, 2024, 11:59:43 AM (5 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

    r84 r85  
    1 unit UFormAbout;
    2 
    3 {$mode delphi}
     1unit FormAbout;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;
     7  StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx;
    108
    119type
    1210  { TFormAbout }
    1311
    14   TFormAbout = class(TForm)
     12  TFormAbout = class(TFormEx)
    1513    ButtonClose: TButton;
    1614    ButtonHomePage: TButton;
     
    2220    PanelButtons: TPanel;
    2321    procedure ButtonHomePageClick(Sender: TObject);
    24     procedure FormCreate(Sender: TObject);
    2522    procedure FormShow(Sender: TObject);
    2623  private
    27     { private declarations }
     24    FApplicationInfo: TApplicationInfo;
    2825  public
    29     AboutDialog: TObject; //TAboutDialog
    3026    procedure UpdateInterface;
     27    property ApplicationInfo: TApplicationInfo read FApplicationInfo write
     28      FApplicationInfo;
    3129  end;
    3230
     
    3533
    3634{$R *.lfm}
    37 
    38 uses
    39   UAboutDialog;
    4035
    4136resourcestring
     
    4843procedure TFormAbout.FormShow(Sender: TObject);
    4944begin
    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;
     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);
    6653  end;
    6754  UpdateInterface;
     
    7057procedure TFormAbout.UpdateInterface;
    7158begin
    72   ButtonHomePage.Enabled := Assigned(AboutDialog) and
    73     Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
     59  ButtonHomePage.Enabled := Assigned(ApplicationInfo);
    7460end;
    7561
    7662procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
    7763begin
    78   OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
    79 end;
    80 
    81 procedure TFormAbout.FormCreate(Sender: TObject);
    82 begin
     64  OpenWebPage(ApplicationInfo.HomePage);
    8365end;
    8466
    8567end.
    86 
Note: See TracChangeset for help on using the changeset viewer.