Ignore:
Timestamp:
Mar 9, 2011, 2:11:40 PM (14 years ago)
Author:
george
Message:
  • Added: Default layout initialization in Demo IDE.
  • Fixed: Tab position switching through popup menu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDockStyleRegions.pas

    r103 r182  
    77uses
    88  Classes, SysUtils, Controls, ExtCtrls, StdCtrls, UCoolDockStyle,
    9   Graphics, Contnrs, Buttons, UCoolDockClientPanel;
     9  Graphics, Contnrs, Buttons, UCoolDockClientPanel, UCoolDockCommon;
    1010
    1111type
     
    2222    function GetHeaderPos: THeaderPos; override;
    2323    procedure SetHeaderPos(const AValue: THeaderPos); override;
    24     constructor Create(AManager: TObject);
     24    constructor Create(AManager: TCoolDockManagerBase);
    2525    destructor Destroy; override;
    2626    procedure UpdateClientSize; override;
     27    procedure SetVisible(const AValue: Boolean); override;
     28    procedure ChangeVisible(Control: TWinControl; Visible: Boolean); override;
    2729  end;
    2830
     
    4547end;
    4648
    47 constructor TCoolDockStyleRegions.Create(AManager: TObject);
     49constructor TCoolDockStyleRegions.Create(AManager: TCoolDockManagerBase);
    4850var
    4951  I: Integer;
     
    5557  for I := 0 to DockPanels.Count - 1 do begin
    5658    if Assigned(TCoolDockClientPanel(DockPanels[I]).Splitter) then
    57     TCoolDockClientPanel(DockPanels[I]).Splitter.Visible := True;
     59      TCoolDockClientPanel(DockPanels[I]).Splitter.Visible := True;
    5860    TCoolDockClientPanel(DockPanels[I]).Visible := True;
    5961    TCoolDockClientPanel(DockPanels[I]).ClientAreaPanel.Parent := TCoolDockClientPanel(DockPanels[I]);
     
    7577  inherited UpdateClientSize;
    7678  with TCoolDockManager(Manager) do
    77   for I := 0 to DockPanels.Count - 1 do begin
    78     TCoolDockClientPanel(DockPanels[I]).Height := DockSite.Height div
    79       DockSite.DockClientCount;
    80     TCoolDockClientPanel(DockPanels[I]).Width := DockSite.Width div
    81       DockSite.DockClientCount;
     79  for I := 0 to DockPanels.Count - 1 do
     80  with TCoolDockClientPanel(DockPanels[I]) do begin
     81    Height := TCoolDockManager(Manager).DockSite.Height div
     82      TCoolDockManager(Manager).DockSite.DockClientCount;
     83    Width := TCoolDockManager(Manager).DockSite.Width div
     84      TCoolDockManager(Manager).DockSite.DockClientCount;
    8285    //TCoolDockClientPanel(FDockPanels[I]).DockPanelPaint(Self);
    83     TCoolDockClientPanel(DockPanels[I]).DockPanelPaint(Self);
     86    DockPanelPaint(Self);
     87    if I < (DockPanels.Count - 1) then begin
     88      if TCoolDockManager(Manager).DockDirection = ddHorizontal then Align := alLeft
     89        else Align := alTop;
     90    end else Align := alClient;
    8491  end;
     92end;
     93
     94procedure TCoolDockStyleRegions.SetVisible(const AValue: Boolean);
     95var
     96  I: Integer;
     97begin
     98  inherited SetVisible(AValue);
     99  with TCoolDockManager(Manager) do
     100  for I := 0 to DockPanels.Count - 1 do
     101
     102        //Show;
     103        //ShowMessage(IntToStr(Control.Tag));
     104      with TCoolDockClientPanel(DockPanels[I]) do begin
     105        if AValue and (not Control.Visible) and (Control.Tag = Integer(dhtTemporal))  then begin
     106          Control.Show;
     107          Control.Tag := Integer(dhtPermanent);
     108        end else
     109        if not AValue then begin
     110          Control.Tag := Integer(dhtTemporal);
     111          Control.Hide;
     112        end;
     113      end;
     114        //ClientAreaPanel.Show;
     115end;
     116
     117procedure TCoolDockStyleRegions.ChangeVisible(Control: TWinControl;
     118  Visible: Boolean);
     119begin
     120  inherited;
    85121end;
    86122
Note: See TracChangeset for help on using the changeset viewer.