Ignore:
Timestamp:
Mar 9, 2012, 9:40:05 AM (13 years ago)
Author:
chronos
Message:
  • Fixed: Memory leak in TReportColumn.
  • Modified: Main item list is created once on application start instead on every tree item mouse doubleclick.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r40 r41  
    8686    procedure LoadFromRegistry;
    8787    procedure SaveToRegistry;
     88    procedure InitDock;
    8889  public
    89     MainPanelForm: TForm;
     90    MainPanelForm: TItemListForm;
    9091    PersistentForm: TPersistentForm;
    9192    TreeState: TTreeState;
     
    9394    procedure UpdateInterface;
    9495    procedure LoadTree;
    95     procedure SetMainPanelForm(Form: TForm);
    9696  end;
    9797
     
    146146end;
    147147
     148procedure TMainForm.InitDock;
     149begin
     150  MainPanelForm := TItemListForm.Create(Self);
     151  MainPanelForm.ManualDock(PanelData, nil, alClient);
     152  MainPanelForm.Align := alClient;
     153end;
     154
    148155procedure TMainForm.UpdateInterface;
    149156begin
     
    154161    Caption := MainPanelForm.Caption + ' - ' + ApplicationInfo.Name
    155162    else Caption :=  ApplicationInfo.Name;
     163  Application.Title := Caption;
    156164  if Assigned(Core.System.Client) then
    157165  with Core.System.Client do
     
    170178procedure TMainForm.FormDestroy(Sender: TObject);
    171179begin
     180  FreeAndNil(MainPanelForm);
    172181  FreeAndNil(Report);
    173182  FreeAndNil(TreeState);
     
    306315  PersistentForm.Load(Self);
    307316  LoadFromRegistry;
     317  InitDock;
    308318  AConnect.Execute;
    309319end;
     
    341351
    342352procedure TMainForm.TreeView1DblClick(Sender: TObject);
    343 var
    344   NewItemListForm: TItemListForm;
    345353begin
    346354  if Assigned(TreeView1.Selected) then begin
    347     NewItemListForm := TItemListForm.Create(Self);
    348     NewItemListForm.SelectedObject.Load(Integer(TreeView1.Selected.Data));
    349     NewItemListForm.Caption := NewItemListForm.SelectedObject.Name;
    350     SetMainPanelForm(NewItemListForm);
     355    MainPanelForm.SelectedObject.Load(Integer(TreeView1.Selected.Data));
     356    MainPanelForm.Caption := MainPanelForm.SelectedObject.Name;
     357    MainPanelForm.Show;
     358    MainPanelForm.Reload;
     359    UpdateInterface;
    351360  end;
    352361end;
     
    407416end;
    408417
    409 procedure TMainForm.SetMainPanelForm(Form: TForm);
    410 begin
    411   MainPanelForm.Free;
    412   MainPanelForm := Form;
    413   MainPanelForm.ManualDock(PanelData, nil, alClient);
    414   MainPanelForm.Align := alClient;
    415   MainPanelForm.Show;
    416   UpdateInterface;
    417 end;
    418 
    419418end.
    420419
Note: See TracChangeset for help on using the changeset viewer.