Ignore:
Timestamp:
Mar 10, 2011, 1:32:41 PM (14 years ago)
Author:
george
Message:
  • Modified: Removed TPanel component from TCoolDockConjoinForm to simplify component structure.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockStyleRegions.pas

    r185 r186  
    7474        // FDockSite.ManualFloat(FDockSite.BoundsRect);
    7575        NewConjoinDockForm.ManualDock(NewDockSite);
    76         AControl.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
     76        AControl.ManualDock(NewConjoinDockForm, nil, InsertAt);
    7777        if DockSite is TForm then
    78           DockSite.ManualDock(NewConjoinDockForm.Panel)
     78          DockSite.ManualDock(NewConjoinDockForm)
    7979        else
    8080        if DockSite is TPanel then
    81           DockSite.Parent.ManualDock(NewConjoinDockForm.Panel);
     81          DockSite.Parent.ManualDock(NewConjoinDockForm);
    8282        UpdateClientSize;
    8383        Exit;
     
    110110var
    111111  ClientPanel: TCoolDockClientPanel;
     112  ClientCount: Integer;
    112113begin
    113114  ClientPanel := TCoolDockManager(Manager).FindControlInPanels(Control);
     
    115116
    116117  TCoolDockManager(Manager).DockPanels.Remove(ClientPanel);
     118  ClientCount := TCoolDockManager(Manager).DockPanels.Count;
    117119
    118120  //if TCoolDockManager(Manager).DockSite.DockClientCount = 2 then FDockDirection := ddNone;
    119   if TCoolDockManager(Manager).DockPanels.Count = 1 then begin
     121  if ClientCount = 1 then begin
    120122    // 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 TCoolDockManager(Manager).DockSite is TCoolDockConjoinForm then
     124    with TCoolDockConjoinForm(TCoolDockManager(Manager).DockSite) do begin
    123125      if Assigned(Parent) then begin
    124126        TCoolDockClientPanel(TCoolDockManager(Manager).DockPanels[0]).Control.ManualDock(HostDockSite);
     
    129131  end;
    130132  inherited RemoveControl(Control);
     133  if ClientCount > 1 then UpdateClientSize;
    131134end;
    132135
     
    191194      else Align := alClient;
    192195
     196    Inc(SplitterLeft, Width);
     197    Inc(SplitterTop, Height);
    193198    Splitter.Left := SplitterLeft;
    194199    Splitter.Top := SplitterTop;
    195     Inc(SplitterLeft, Width);
    196     Inc(SplitterTop, Height);
    197200    Splitter.Parent := TCoolDockManager(Manager).DockSite;
    198201    Splitter.Align := BaseAlign;
    199202    Splitter.Visible := I < (DockPanels.Count - 1);
    200 
     203    Inc(SplitterLeft, Splitter.Width);
     204    Inc(SplitterTop, Splitter.Height);
    201205
    202206    DockPanelPaint(Self);
Note: See TracChangeset for help on using the changeset viewer.