Ignore:
Timestamp:
Mar 22, 2011, 9:49:17 AM (14 years ago)
Author:
george
Message:
  • Added: ConjoinForms caption update.
  • Fixed: Docking new clients to TCDManagerRegions in different direction create new sub conjoin form.
Location:
Docking/CoolDocking/Managers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/Managers/UCDManagerRegions.pas

    r215 r216  
    8080    //Canvas.FillRect(R);
    8181    if Visible then begin
    82       if ControlPanel.DockClientCount = 0 then
    83         Header.DrawGrabber(Canvas, Control) else
    84       Header.DrawGrabber(Canvas, ControlPanel);
     82      Header.Invalidate;
    8583    end;
    8684  end;
     
    201199        // Direction change, create conjoin form
    202200        NewConjoinDockForm := CreateContainer(InsertAt);
    203         NewDockSite := DockSite.HostDockSite;
    204         // FDockSite.ManualFloat(FDockSite.BoundsRect);
    205         NewConjoinDockForm.ManualDock(NewDockSite);
    206         Control.ManualDock(NewConjoinDockForm, nil, InsertAt);
    207         if DockSite is TForm then
    208           DockSite.ManualDock(NewConjoinDockForm)
    209         else
    210         if DockSite is TPanel then
    211           DockSite.Parent.ManualDock(NewConjoinDockForm);
     201        FreeParentIfEmpty := False;
     202        for I := DockSite.DockClientCount - 1 downto 0 do begin
     203          DockSite.DockClients[I].ManualDock(NewConjoinDockForm);
     204        end;
     205        FreeParentIfEmpty := True;
     206        NewConjoinDockForm.ManualDock(DockSite);
     207        Control.ManualDock(DockSite, nil, InsertAt);
     208        NewConjoinDockForm.UpdateCaption;
    212209        UpdateClientSize;
    213210        Exit;
     
    233230
    234231  //if TCDManager(Manager).DockSite.DockClientCount = 2 then FDockDirection := ddNone;
    235   if ClientCount = 1 then begin
     232  if FreeParentIfEmpty and (ClientCount = 1) then begin
    236233    // Last removed control => Free parent if it is TCDConjoinForm
    237234    if Self.DockSite is TCDConjoinForm then
     
    241238      end else TCDManagerItem(DockItems[0]).Control.ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
    242239      ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
     240      inherited RemoveControl(Control);
    243241      Free;
     242      Exit;
    244243    end;
    245244  end;
  • Docking/CoolDocking/Managers/UCDManagerTabs.pas

    r215 r216  
    9090  // Show current dock clients in parent dock sites
    9191  if TControl(Sender).Visible then
    92     TControl(Sender).HostDockSite.Visible := True;
     92    if Assigned(TControl(Sender).HostDockSite) then
     93      TControl(Sender).HostDockSite.Visible := True;
    9394
    9495  {Temp := TControl(Sender);
     
    271272  if Assigned(ManagerItem) then begin
    272273    Control.RemoveHandlerOnVisibleChanged(ManagerItem.VisibleChange);
    273   end;
     274  end else raise Exception.Create(Format('Control %s not found in DockItems', [Control.Name]));
    274275
    275276  DockItems.Remove(ManagerItem);
     
    285286      end else TCDManagerItem(DockItems[0]).Control.ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
    286287      ManualFloat(Rect(Left, Top, Left + Width, Top + Height));
     288      //UpdateClientSize;
     289      inherited RemoveControl(Control);
    287290      Free;
    288     end;
    289   end else UpdateClientSize;
     291      Exit;
     292    end;
     293  end;
     294  //if ClientCount > 0 then
     295  UpdateClientSize;
    290296  inherited RemoveControl(Control);
    291297end;
     
    346352
    347353  while PageControl.PageList.Count > DockItems.Count do begin
    348     TCDManagerTabsItem(DockItems[I]).Control.Parent := nil;
    349     PageControl.Pages[PageControl.PageCount - 1].Parent := nil;
     354//    TCDManagerTabsItem(DockItems[DockItems.Count - 1]).Control.Visible := False;
     355//    TCDManagerTabsItem(DockItems[DockItems.Count - 1]).Control.Parent := nil;
     356    //PageControl.Pages[PageControl.PageCount - 1].Parent := nil;
    350357    PageControl.Pages[PageControl.PageCount - 1].Free;
    351358    TabImageList.Delete(TabImageList.Count - 1);
Note: See TracChangeset for help on using the changeset viewer.