Ignore:
Timestamp:
Apr 27, 2012, 8:34:10 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Change concept of dock manager items logical visibility vs TControl real visibility. Not visible controls are hidden by manager using TCDManager.DockSiteVisible property. TCDManager provide events OnDockSiteHide and OnDockSiteShow for handling logical visibility.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Demo/Testing/UMainForm.pas

    r354 r355  
    2727    MenuItem3: TMenuItem;
    2828    MenuItem4: TMenuItem;
    29     PageControl1: TPageControl;
    3029    Panel1: TPanel;
    31     TabControl1: TTabControl;
    32     TabSheet1: TTabSheet;
    33     TabSheet2: TTabSheet;
    34     TabSheet3: TTabSheet;
    35     TabSheet4: TTabSheet;
    3630    procedure Button1Click(Sender: TObject);
    3731    procedure Button2Click(Sender: TObject);
     
    4337    procedure PageControl1Change(Sender: TObject);
    4438  private
     39    procedure DockSiteShowExecute(Sender: TObject);
     40    procedure DockSiteHideExecute(Sender: TObject);
    4541  public
    4642    FormIndex: Integer;
     
    7975  NewDockForm.ManualDock(Form1);
    8076  TCDManager(Panel1.DockManager).DockStyle := dsTabs;
     77  NewDockForm.ManualDock(Panel1);
    8178(*  ConjoinedDockForm1 := TCDManager(Panel1.DockManager).CreateConjoinForm;
    8279  ConjoinedDockForm1.Name := 'Model';;
     
    109106end;
    110107
     108procedure TMainForm.DockSiteShowExecute(Sender: TObject);
     109begin
     110  if Sender is TControl then
     111    DebugLog(TControl(Sender).Name + ' Show');
     112end;
     113
     114procedure TMainForm.DockSiteHideExecute(Sender: TObject);
     115begin
     116  if Sender is TControl then
     117    DebugLog(TControl(Sender).Name + ' Hide');
     118end;
     119
    111120function TMainForm.NewDockForm: TDockForm;
    112121begin
     
    117126  Result.Caption := Result.Name;
    118127  Result.Memo1.Text := Result.Name;
     128  TCDManager(Result.DockManager).OnDockSiteHide := DockSiteHideExecute;
     129  TCDManager(Result.DockManager).OnDockSiteShow := DockSiteShowExecute;
    119130  //Result.DragKind := dkDock;
    120131  //Result.DragMode := dmAutomatic;
Note: See TracChangeset for help on using the changeset viewer.