Ignore:
Timestamp:
Sep 10, 2022, 10:21:48 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Do not create all application forms at initialization phase but dynamically.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r27 r28  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    7   ComCtrls;
     7  ComCtrls, UFormTables;
    88
    99type
     
    3030    procedure FormActivate(Sender: TObject);
    3131    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     32    procedure FormCreate(Sender: TObject);
     33    procedure FormDestroy(Sender: TObject);
    3234    procedure FormShow(Sender: TObject);
    3335  private
    3436    procedure SetToolbarHints;
    3537  public
     38    FormTables: TFormTables;
    3639    procedure DockInit;
    3740    procedure UpdateInterface;
     
    4750
    4851uses
    49   UCore, UFormTables;
     52  UCore;
    5053
    5154{ TFormMain }
     
    6265  Core.Done;
    6366  Core.PersistentForm1.Save(Self);
     67end;
     68
     69procedure TFormMain.FormCreate(Sender: TObject);
     70begin
     71  FormTables := TFormTables.Create(nil);
     72end;
     73
     74procedure TFormMain.FormDestroy(Sender: TObject);
     75begin
     76  FreeAndNil(FormTables);
    6477end;
    6578
     
    8699    NewCaption := Core.DbClient.ConnectProfile.Name + ' - ' + NewCaption;
    87100  FormMain.Caption := NewCaption;
     101  FormTables.UpdateInterface;
    88102end;
    89103
Note: See TracChangeset for help on using the changeset viewer.