Ignore:
Timestamp:
Mar 11, 2011, 10:07:38 AM (14 years ago)
Author:
george
Message:
  • Modified: Classes which iherits from TCDStyle changed to inherit from TCDManager. Now all styles will be different dock managers. Field DockStyleHanler of TCDManager removed and DockStyle property changes TCDManager descendends.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCDStyleTabs.pas

    r189 r191  
    77uses
    88  Classes, Controls, ExtCtrls, ComCtrls, SysUtils, Dialogs,
    9   Menus, UCDStyle, Forms, UCDClientPanel, UCDCommon;
     9  Menus, Forms, UCDClientPanel, UCDCommon, UCDManager;
    1010
    1111type
     
    1313  { TCDStyleTabs }
    1414
    15   TCDStyleTabs = class(TCDStyle)
     15  TCDStyleTabs = class(TCDManager)
     16  public
    1617    MouseDown: Boolean;
    1718    MouseButton: TMouseButton;
     
    2526    procedure TabControlMouseUp(Sender: TObject; Button: TMouseButton;
    2627      Shift: TShiftState; X, Y: Integer);
    27     procedure InsertControl(AControl: TControl; InsertAt: TAlign); override;
     28    procedure InsertControl(AControl: TControl; InsertAt: TAlign;
     29      DropCtl: TControl); override;
    2830    procedure UpdateClientSize; override;
    2931  private
     
    3335  public
    3436    constructor Create(AManager: TCDManagerBase);
    35     procedure SetVisible(const AValue: Boolean); override;
     37    procedure DoSetVisible(const AValue: Boolean);
    3638    destructor Destroy; override;
    3739    procedure ChangeVisible(Control: TWinControl; Visible: Boolean); override;
     
    4547
    4648uses
    47   UCDClient, UCDManager;
     49  UCDClient;
    4850
    4951{ TCDStyleTabs }
     
    5254begin
    5355  if Assigned(PageControl.ActivePage) then
    54     TCDClientPanel(TCDManager(Manager).DockPanels[PageControl.TabIndex]).Control.Hide;
     56    TCDClientPanel(DockPanels[PageControl.TabIndex]).Control.Hide;
    5557end;
    5658
     
    5860begin
    5961  if MouseDown then
    60   with TCDManager(Manager) do
    6162  if Assigned(PageControl.ActivePage) then begin
    6263    TCDClientPanel(DockPanels[PageControl.TabIndex]).ClientAreaPanel.DockSite := False;
     
    7172begin
    7273  // Hide all clients
    73   with TCDManager(Manager) do
    7474  for I := 0 to DockPanels.Count - 1 do
    7575    if TCDClientPanel(DockPanels[I]).Control.Visible
     
    9393
    9494  // Show selected
    95   with TCDManager(Manager) do
    9695  if (PageControl.TabIndex <> -1) and (DockPanels.Count > PageControl.TabIndex)
    9796//  and not TCDClientPanel(DockPanels[PageControl.TabIndex]).Control.Visible
     
    144143  NewTabSheet: TTabSheet;
    145144begin
    146   inherited;
    147145
    148146  TabImageList := TImageList.Create(TCDManager(AManager).DockSite); //FDockSite);
    149147  with TabImageList do begin
    150     Name := TCDManager(Manager).DockSite.Name + '_' + 'ImageList';
     148    Name := DockSite.Name + '_' + 'ImageList';
    151149  end;
    152150  PageControl := TPageControl.Create(TCDManager(AManager).DockSite); //FDockSite);
    153151  with PageControl do begin
    154     Parent := TCDManager(Manager).DockSite;
    155     Name := TCDManager(Manager).DockSite.Name + '_' + 'TabControl';
     152    Parent := Self.DockSite;
     153    Name := Self.DockSite.Name + '_' + 'TabControl';
    156154    Visible := False;
    157155    Align := alTop;
     
    160158    OnChange := TabControlChange;
    161159    MultiLine := True;
    162     PopupMenu := TCDManager(Manager).PopupMenu;
     160    PopupMenu := Self.PopupMenu;
    163161    OnMouseLeave := TabControlMouseLeave;
    164162    OnMouseDown := TabControlMouseDown;
     
    174172  PageControl.Visible := True;
    175173  //TabImageList.Clear;
    176   with TCDManager(Manager) do
    177174  for I := 0 to DockPanels.Count - 1 do
    178175    Self.InsertControlNoUpdate(TCDClientPanel(DockPanels[I]).Control, alNone);
     
    189186procedure TCDStyleTabs.Switch(Index: Integer);
    190187begin
    191   inherited Switch(Index);
    192188  PageControl.TabIndex := Index;
    193189end;
     
    199195begin
    200196  inherited;
    201   with TCDManager(Manager) do begin
     197  begin
    202198    NewPanel := TCDClientPanel.Create(nil);
    203199    with NewPanel do begin
    204       Parent := TCDManager(Manager).DockSite;
    205       OwnerDockManager := TCDManager(Manager);
     200      Parent := Self.DockSite;
     201      OwnerDockManager := Self;
    206202      if DockStyle = dsList then Visible := True;
    207203      Align := alClient;
    208       Header.PopupMenu := TCDManager(Manager).PopupMenu;
     204      Header.PopupMenu := Self.PopupMenu;
    209205      //PopupMenu.Parent := Self.DockSite;
    210206    end;
     
    241237end;
    242238
    243 procedure TCDStyleTabs.InsertControl(AControl: TControl; InsertAt: TAlign);
     239procedure TCDStyleTabs.InsertControl(AControl: TControl; InsertAt: TAlign;
     240  DropCtl: TControl);
    244241var
    245242  NewTabSheet: TTabSheet;
     
    255252begin
    256253  inherited UpdateClientSize;
    257   with TCDManager(Manager) do
    258254  for I := 0 to DockPanels.Count - 1 do begin
    259255    //TCDClientPanel(DockPanels[I]).ClientAreaPanel.Width := DockSite.Width;
     
    263259end;
    264260
    265 procedure TCDStyleTabs.SetVisible(const AValue: Boolean);
    266 begin
    267   inherited SetVisible(AValue);
    268   with TCDManager(Manager) do
     261procedure TCDStyleTabs.DoSetVisible(const AValue: Boolean);
     262begin
    269263    if (PageControl.TabIndex >= 0) and (PageControl.TabIndex < DockPanels.Count) then
    270264      with TCDClientPanel(DockPanels[PageControl.TabIndex]) do begin
     
    288282    //if Assigned(TWinControl(Control).DockManager) then
    289283    //with TCDManager(TWinControl(Control).DockManager) do
    290     if Assigned(Manager) then
    291     with TCDManager(Manager) do
    292284    begin
    293285//    ShowMessage(IntToStr(TabControl.TabIndex) + ' ' + IntToStr(DockPanels.Count));
     
    312304//    if Assigned(TWinControl(Control).DockManager) then
    313305//    with TCDManager(TWinControl(Control).DockManager) do
    314     if Assigned(Manager) then
    315     with TCDManager(Manager) do
    316306    begin
    317307//      if Control.Tag = 0 then begin
Note: See TracChangeset for help on using the changeset viewer.