Ignore:
Timestamp:
Mar 18, 2011, 2:16:28 PM (14 years ago)
Author:
george
Message:
 
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.