Ignore:
Timestamp:
Apr 3, 2025, 10:49:00 PM (13 days ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/ApplicationInfo.pas

    r20 r21  
    1 unit UApplicationInfo;
    2 
    3 {$mode delphi}
     1unit ApplicationInfo;
    42
    53interface
    64
    75uses
    8   SysUtils, Registry, Classes, Forms, URegistry;
     6  SysUtils, Classes, Forms, RegistryEx, Controls, Graphics, LCLType;
    97
    108type
     
    1412  TApplicationInfo = class(TComponent)
    1513  private
     14    FDescription: TTranslateString;
     15    FIcon: TBitmap;
    1616    FIdentification: Byte;
    1717    FLicense: string;
     
    3232  public
    3333    constructor Create(AOwner: TComponent); override;
     34    destructor Destroy; override;
    3435    property Version: string read GetVersion;
     36    function GetRegistryContext: TRegistryContext;
    3537  published
    3638    property Identification: Byte read FIdentification write FIdentification;
     
    4547    property EmailContact: string read FEmailContact write FEmailContact;
    4648    property AppName: string read FAppName write FAppName;
     49    property Description: TTranslateString read FDescription write FDescription;
    4750    property ReleaseDate: TDateTime read FReleaseDate write FReleaseDate;
    4851    property RegistryKey: string read FRegistryKey write FRegistryKey;
    4952    property RegistryRoot: TRegistryRoot read FRegistryRoot write FRegistryRoot;
    5053    property License: string read FLicense write FLicense;
     54    property Icon: TBitmap read FIcon write FIcon;
    5155  end;
    5256
    5357procedure Register;
    5458
     59
    5560implementation
    56                        
     61
    5762procedure Register;
    5863begin
     
    7176constructor TApplicationInfo.Create(AOwner: TComponent);
    7277begin
    73   inherited Create(AOwner);
     78  inherited;
    7479  FVersionMajor := 1;
    7580  FIdentification := 1;
     
    7782  FRegistryKey := '\Software\' + FAppName;
    7883  FRegistryRoot := rrKeyCurrentUser;
     84  FIcon := TBitmap.Create;
     85end;
     86
     87destructor TApplicationInfo.Destroy;
     88begin
     89  FreeAndNil(FIcon);
     90  inherited;
     91end;
     92
     93function TApplicationInfo.GetRegistryContext: TRegistryContext;
     94begin
     95  Result := TRegistryContext.Create(RegistryRoot, RegistryKey);
    7996end;
    8097
Note: See TracChangeset for help on using the changeset viewer.