Ignore:
Timestamp:
Apr 27, 2012, 8:34:10 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Change concept of dock manager items logical visibility vs TControl real visibility. Not visible controls are hidden by manager using TCDManager.DockSiteVisible property. TCDManager provide events OnDockSiteHide and OnDockSiteShow for handling logical visibility.
Location:
Docking/CoolDocking/Managers
Files:
2 edited

Legend:

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

    r354 r355  
    307307  VisibleControlsCount: Integer;
    308308begin
     309  inherited;
    309310  if FUpdateCount = 0 then begin
    310311  DebugLog('TCDManagerRegions.UpdateClientSize');
    311   inherited;
    312312  VisibleControlsCount := DockSite.VisibleDockClientCount;
    313   if DockSite is TForm then
    314     DockSite.Visible := (VisibleControlsCount > 0);
     313  if DockSite is TForm then begin
     314    DockSiteVisible := VisibleControlsCount > 0;
     315  end;
    315316  if VisibleControlsCount = 0 then VisibleControlsCount := 1;
    316317
     
    360361begin
    361362  inherited;
     363  //if DockSite.Visible <> AValue then
    362364  try
    363365    BeginUpdate;
    364366    for I := 0 to DockItems.Count - 1 do
    365367      with TCDManagerRegionsItem(DockItems[I]) do begin
    366         if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal))  then begin
    367           Control.Show;
    368           Control.Tag := Integer(dhtPermanent);
    369         end else
    370         if not AValue then begin
    371           Control.Tag := Integer(dhtTemporal);
    372           Control.Hide;
    373         end;
     368        TCDManager(Control.DockManager).DockSiteVisible := AValue;
    374369      end;
    375370        //ClientAreaPanel.Show;
  • Docking/CoolDocking/Managers/UCDManagerTabs.pas

    r354 r355  
    8787      Update;
    8888      Switch(DockItems.IndexOf(FindControlInPanels(TControl(Sender))));
    89       TCDManagerTabsItem(DockItems[DockItems.IndexOf(
    90         FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent;
     89      //TCDManagerTabsItem(DockItems[DockItems.IndexOf(
     90      //  FindControlInPanels(TControl(Sender)))]).HideType := dhtPermanent;
    9191    end else Update;
    9292  end;
     
    124124  inherited;
    125125  if (PageControl.TabIndex >= 0) and (PageControl.TabIndex < DockItems.Count) then
    126     with TCDManagerItem(DockItems[PageControl.TabIndex]) do begin
    127       if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal)) then begin
    128         Control.Show;
    129         Control.Tag := Integer(dhtPermanent);
    130       end;
    131     end;
     126    with TCDManagerItem(DockItems[PageControl.TabIndex]) do
     127      TCDManager(Control.DockManager).DockSiteVisible := True;
    132128end;
    133129
     
    399395    Control.Align := alClient;
    400396    if PageControl.PageIndex = I then begin
    401       if (not Control.Visible) and (HideType = dhtTemporal) then
    402         Control.Visible := True;
     397      TCDManager(Control.DockManager).DockSiteVisible := True;
     398      if not Control.Visible then Control.Show;
    403399    end else begin
    404       if Control.Visible then begin
    405         HideType := dhtTemporal;
    406         Control.Visible := False;
    407       end;
    408     end;
    409     PageControl.Pages[I].TabVisible := Control.Visible or (HideType = dhtTemporal);
     400      TCDManager(Control.DockManager).DockSiteVisible := False;
     401    end;
     402    PageControl.Pages[I].TabVisible := Control.Visible;
    410403
    411404    //TCDClientPanel(DockPanels[I]).ClientAreaPanel.Width := DockSite.Width;
Note: See TracChangeset for help on using the changeset viewer.