Ignore:
Timestamp:
Jun 7, 2024, 11:59:43 AM (7 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
Location:
trunk/Packages/Common/Forms
Files:
7 added
3 moved

Legend:

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

    r84 r85  
    11object FormAbout: TFormAbout
    2   Left = 1014
     2  Left = 624
    33  Height = 402
    4   Top = 577
     4  Top = 622
    55  Width = 702
    66  Caption = 'About'
     
    88  ClientWidth = 702
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    1110  OnShow = FormShow
    1211  Position = poScreenCenter
    13   LCLVersion = '2.0.10.0'
     12  LCLVersion = '2.2.6.0'
    1413  object LabelDescription: TLabel
    1514    Left = 30
    16     Height = 24
     15    Height = 26
    1716    Top = 135
    1817    Width = 642
     
    2827  object LabelContent: TLabel
    2928    Left = 30
    30     Height = 24
    31     Top = 189
     29    Height = 26
     30    Top = 191
    3231    Width = 642
    3332    Align = alTop
     
    6766      Height = 74
    6867      Top = 30
    69       Width = 72
     68      Width = 71
    7069      Proportional = True
    7170      Stretch = True
     
    9493    end
    9594    object ButtonClose: TButton
    96       Left = 532
     95      Left = 531
    9796      Height = 38
    9897      Top = 24
    99       Width = 140
     98      Width = 141
    10099      Anchors = [akRight, akBottom]
    101100      Caption = 'Close'
  • 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.