Ignore:
Timestamp:
Mar 10, 2011, 11:20:08 AM (14 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockStyleRegions.pas

    r184 r185  
    7373        NewDockSite := DockSite.HostDockSite;
    7474        // FDockSite.ManualFloat(FDockSite.BoundsRect);
     75        NewConjoinDockForm.ManualDock(NewDockSite);
    7576        AControl.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
    7677        if DockSite is TForm then
     
    7980        if DockSite is TPanel then
    8081          DockSite.Parent.ManualDock(NewConjoinDockForm.Panel);
    81         NewConjoinDockForm.ManualDock(NewDockSite);
    8282        UpdateClientSize;
    8383        Exit;
     
    114114  Control.RemoveHandlerOnVisibleChanged(ClientPanel.VisibleChange);
    115115
    116   if TCoolDockManager(Manager).DockSite.DockClientCount = 2 then FDockDirection := ddNone;
     116  TCoolDockManager(Manager).DockPanels.Remove(ClientPanel);
     117
     118  //if TCoolDockManager(Manager).DockSite.DockClientCount = 2 then FDockDirection := ddNone;
     119  if TCoolDockManager(Manager).DockPanels.Count = 1 then begin
     120    // Last removed control => Free parent if it is TCoolDockConjoinForm
     121    if TCoolDockManager(Manager).DockSite.Parent is TCoolDockConjoinForm then
     122    with TCoolDockConjoinForm(TCoolDockManager(Manager).DockSite.Parent) do begin
     123      if Assigned(Parent) then begin
     124        TCoolDockClientPanel(TCoolDockManager(Manager).DockPanels[0]).Control.ManualDock(HostDockSite);
     125      end else TCoolDockClientPanel(TCoolDockManager(Manager).DockPanels[0]).Control.ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
     126      ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
     127      Free;
     128    end;
     129  end;
    117130  inherited RemoveControl(Control);
    118131end;
Note: See TracChangeset for help on using the changeset viewer.