Changeset 20 for trunk/Packages


Ignore:
Timestamp:
Mar 23, 2018, 1:59:25 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Database classes reorganized. Now TDbConnectProfile is class which holds information about connection to database.
  • Modified: TDbManager is top most class for managing other database classes.
  • Modified: TDbConnectParams class contains client specific parameters for connect profile.
Location:
trunk/Packages/Common
Files:
3 edited

Legend:

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

    r15 r20  
    66
    77uses
    8   SysUtils, Registry, Classes, Forms, URegistry;
     8  SysUtils, Classes, Forms, URegistry, LCLType;
    99
    1010type
     
    1414  TApplicationInfo = class(TComponent)
    1515  private
    16     FDescription: string;
     16    FDescription: TTranslateString;
    1717    FIdentification: Byte;
    1818    FLicense: string;
  • trunk/Packages/Common/UPersistentForm.pas

    r15 r20  
    5656  I: Integer;
    5757  WinControl: TWinControl;
    58   Count: Integer;
    5958begin
    6059  if Control is TListView then begin
     
    217216
    218217procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False);
    219 var
    220   LoadDefaults: Boolean;
    221218begin
    222219  Self.Form := Form;
     
    230227
    231228  if not EqualRect(FormNormalSize, FormRestoredSize) or
    232     (LoadDefaults and DefaultMaximized) then begin
     229    DefaultMaximized then begin
    233230    // Restore to maximized state
    234231    Form.WindowState := wsNormal;
  • trunk/Packages/Common/URegistry.pas

    r15 r20  
    3737    function DeleteKeyRecursive(const Key: string): Boolean;
    3838    function OpenKey(const Key: string; CanCreate: Boolean): Boolean;
     39    function GetValue(const Name: string; const DefaultValue: Integer): Integer; overload;
     40    function GetValue(const Name: string; const DefaultValue: string): string; overload;
     41    function GetValue(const Name: string; const DefaultValue: Boolean): Boolean; overload;
     42    function GetValue(const Name: string; const DefaultValue: Double): Double; overload;
     43    procedure SetValue(const Name: string; const Value: Integer); overload;
     44    procedure SetValue(const Name: string; const Value: string); overload;
     45    procedure SetValue(const Name: string; const Value: Boolean); overload;
     46    procedure SetValue(const Name: string; const Value: Double); overload;
    3947    property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext;
    4048  end;
     
    97105      Result := DefaultValue;
    98106    end;
     107end;
     108
     109function TRegistryEx.GetValue(const Name: string; const DefaultValue: Integer
     110  ): Integer;
     111begin
     112  Result := ReadIntegerWithDefault(Name, DefaultValue);
     113end;
     114
     115function TRegistryEx.GetValue(const Name: string; const DefaultValue: string
     116  ): string;
     117begin
     118  Result := ReadStringWithDefault(Name, DefaultValue);
     119end;
     120
     121function TRegistryEx.GetValue(const Name: string; const DefaultValue: Boolean
     122  ): Boolean;
     123begin
     124  Result := ReadBoolWithDefault(Name, DefaultValue);
     125end;
     126
     127function TRegistryEx.GetValue(const Name: string; const DefaultValue: Double
     128  ): Double;
     129begin
     130  Result := ReadFloatWithDefault(Name, DefaultValue);
     131end;
     132
     133procedure TRegistryEx.SetValue(const Name: string; const Value: Integer);
     134begin
     135  WriteInteger(Name, Value);
     136end;
     137
     138procedure TRegistryEx.SetValue(const Name: string; const Value: string);
     139begin
     140  WriteString(Name, Value);
     141end;
     142
     143procedure TRegistryEx.SetValue(const Name: string; const Value: Boolean);
     144begin
     145  WriteBool(Name, Value);
     146end;
     147
     148procedure TRegistryEx.SetValue(const Name: string; const Value: Double);
     149begin
     150  WriteFloat(Name, Value);
    99151end;
    100152
Note: See TracChangeset for help on using the changeset viewer.