Changeset 32 for trunk/Core.pas


Ignore:
Timestamp:
Jun 29, 2024, 7:58:36 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from units names.
  • Modified: Use TFormEx for all forms.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r31 r32  
    1 unit UCore;
     1unit Core;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, FileUtil, Controls, ActnList, UDatabase, Translator,
    7   ApplicationInfo, PersistentForm, Forms, RegistryEx, ScaleDPI;
     6  Classes, SysUtils, FileUtil, Controls, ActnList, DbEngine, Translator,
     7  ApplicationInfo, PersistentForm, Forms, RegistryEx, ScaleDPI, Theme, FormMain;
    88
    99type
     
    1818    AExit: TAction;
    1919    ActionList1: TActionList;
     20    ThemeManager1: TThemeManager;
    2021    Translator1: TTranslator;
    2122    ImageList1: TImageList;
     
    3738    Preferences: TPreferences;
    3839    DbManager: TDbManager;
     40    FormMain: TFormMain;
    3941    procedure LoadConfig;
    4042    procedure SaveConfig;
     
    5557
    5658uses
    57   UFormTables, UFormConnect, FormAbout, UFormDatabases, UFormPreferences,
    58   UFormMain;
     59  FormTables, FormAbout, FormDatabases, FormPreferences, FormEx;
    5960
    6061{$R *.lfm}
     
    6667  DbManager := TDbManager.Create;
    6768  Preferences := TPreferences.Create;
     69
     70  TFormEx.ScaleDPI := ScaleDPI1;
     71  TFormEx.Translator := Translator1;
     72  TFormEx.ThemeManager := ThemeManager1;
     73  TFormEx.PersistentForm := PersistentForm1;
     74
     75  FormMain := TFormMain.Create(nil);
     76  FormMain.Show;
    6877end;
    6978
    7079procedure TCore.DataModuleDestroy(Sender: TObject);
    7180begin
     81  FreeAndNil(FormMain);
    7282  DbClient := nil;
    7383  FreeAndNil(Preferences);
     
    8999  with TFormDatabases.Create(nil) do
    90100  try
     101    DbManager := Self.DbManager;
    91102    if ShowModal = mrOk then begin
    92103      DbClient := nil;
     
    201212  SaveConfig;
    202213  DbClient := nil;
     214  Application.Terminate;
    203215end;
    204216
Note: See TracChangeset for help on using the changeset viewer.