Ignore:
Timestamp:
Mar 18, 2011, 2:16:28 PM (14 years ago)
Author:
george
Message:
 
Location:
Docking/CoolDocking/Managers
Files:
2 edited

Legend:

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

    r207 r209  
    1717    PanelHeader: TCDPanelHeader;
    1818    Splitter: TSplitter;
     19    procedure VisibleChange(Sender: TObject); override;
    1920    procedure Paint(Sender: TObject); override;
    2021    constructor Create;
     
    5657{ TCDManagerRegionsItem }
    5758
     59procedure TCDManagerRegionsItem.VisibleChange(Sender: TObject);
     60begin
     61  inherited VisibleChange(Sender);
     62  PanelHeader.Visible := Control.Visible;
     63  Manager.UpdateClientSize;
     64end;
     65
    5866procedure TCDManagerRegionsItem.Paint(Sender: TObject);
    5967var
     
    273281  SplitterTop: Integer;
    274282  BaseAlign: TAlign;
     283  VisibleControlsCount: Integer;
    275284begin
    276285  inherited UpdateClientSize;
     
    280289  SplitterLeft := 0;
    281290  SplitterTop := 0;
     291  VisibleControlsCount := DockSite.VisibleDockClientCount;
     292  DockSite.Visible := VisibleControlsCount > 0;
     293  if VisibleControlsCount = 0 then VisibleControlsCount := 1;
     294
    282295  for I := 0 to DockItems.Count - 1 do
    283   with TCDManagerRegionsItem(DockItems[I]) do begin
     296  with TCDManagerRegionsItem(DockItems[I]) do
     297  begin
    284298    PanelHeader.Left := SplitterLeft;
    285299    PanelHeader.Top := SplitterTop;
    286300    PanelHeader.Height := Self.DockSite.Height div
    287       Self.DockSite.DockClientCount;
     301      VisibleControlsCount;
    288302    PanelHeader.Width := Self.DockSite.Width div
    289       Self.DockSite.DockClientCount;
    290     PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible;
     303      VisibleControlsCount;
     304    if Assigned(TWinControl(Control).DockManager) then
     305      PanelHeader.Header.Visible := TCDManager(TWinControl(Control).DockManager).HeaderVisible;
    291306    PanelHeader.Header.Title.Caption := TForm(Control).Caption;
    292307    Paint(Self);
  • Docking/CoolDocking/Managers/UCDManagerTabs.pas

    r208 r209  
    3434    procedure InsertControlPanel(AControl: TControl; InsertAt: TAlign;
    3535      DropCtl: TControl); override;
    36     procedure UpdateClientSize; override;
    3736    function FindControlInPanels(Control: TControl): TCDManagerItem; override;
    3837    function GetHeaderPos: THeaderPos; override;
     
    4140    TabImageList: TImageList;
    4241    PageControl: TPageControl;
     42    procedure UpdateClientSize; override;
    4343    procedure SetHeaderPos(const AValue: THeaderPos); override;
    4444    procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); virtual;
     
    290290  end;
    291291  inherited RemoveControl(Control);
    292   if ClientCount > 1 then UpdateClientSize;
     292  //if ClientCount > 0 then
     293  UpdateClientSize;
    293294end;
    294295
     
    348349
    349350  while PageControl.PageList.Count > DockItems.Count do begin
    350     PageControl.Pages[PageControl.PageCount - 1].Parent := nil;
     351    //PageControl.Pages[PageControl.PageCount - 1].Parent := nil;
    351352    PageControl.Pages[PageControl.PageCount - 1].Free;
    352353    TabImageList.Delete(TabImageList.Count - 1);
Note: See TracChangeset for help on using the changeset viewer.