Ignore:
Timestamp:
Mar 10, 2011, 1:32:41 PM (13 years ago)
Author:
george
Message:
  • Modified: Removed TPanel component from TCoolDockConjoinForm to simplify component structure.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCoolDocking.pas

    r185 r186  
    2727  TCoolDockConjoinForm = class(TCoolDockConjoinFormBase)
    2828  public
    29     Panel: TPanel;
    3029    CoolDockClient: TCoolDockClient;
    3130    procedure FormShow(Sender : TObject);
     
    3534  private
    3635    procedure SetName(const NewName: TComponentName); override;
    37     procedure PanelVisibleChange(Sender: TObject);
    3836  end;
    3937
     
    287285  NewForm: TForm;
    288286begin
    289   if (FDockSite is TForm) then begin
     287  if (FDockSite is TForm) and (not (FDockSite is TCoolDockConjoinForm)) then begin
    290288    if (not Assigned(FDockSite.Parent)) then begin
    291289      // Create conjointed form
    292290      NewConjoinDockForm := CreateContainer(InsertAt);
    293       FDockSite.ManualDock(NewConjoinDockForm.Panel);
    294       Control.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
     291      FDockSite.ManualDock(NewConjoinDockForm);
     292      Control.ManualDock(NewConjoinDockForm, nil, InsertAt);
    295293    end else begin
    296294      NewConjoinDockForm := CreateContainer(InsertAt);
     
    298296//      FDockSite.ManualFloat(FDockSite.BoundsRect);
    299297      NewConjoinDockForm.ManualDock(NewDockSite, nil, InsertAt);
    300       FDockSite.ManualDock(NewConjoinDockForm.Panel);
    301       Control.ManualDock(NewConjoinDockForm.Panel, nil, InsertAt);
     298      FDockSite.ManualDock(NewConjoinDockForm);
     299      Control.ManualDock(NewConjoinDockForm, nil, InsertAt);
    302300    end;
    303301  end else
    304   if (FDockSite is TPanel) or (FDockSite is TCoolDockClientPanel) then begin
     302  if (FDockSite is TCoolDockConjoinForm) or (FDockSite is TPanel) or (FDockSite is TCoolDockClientPanel) then begin
    305303    InsertControlPanel(Control, InsertAt, DropCtl);
    306304  end;
     
    479477procedure TCoolDockConjoinForm.FormShow(Sender: TObject);
    480478begin
    481   Panel.Show;
    482   TCoolDockManager(Panel.DockManager).Visible := True;
     479  TCoolDockManager(DockManager).Visible := True;
    483480end;
    484481
     
    487484  I: Integer;
    488485begin
    489   Panel.Hide;
    490   TCoolDockManager(Panel.DockManager).Visible := False;
     486  TCoolDockManager(DockManager).Visible := False;
    491487  // Hide all docked childs
    492   with TCoolDockManager(Panel.DockManager) do
     488  with TCoolDockManager(DockManager) do
    493489  for I := 0 to DockPanels.Count - 1 do
    494490    if Assigned(TCoolDockClientPanel(DockPanels[I]).Control) then begin
     
    501497begin
    502498  inherited CreateNew(TheOwner);
    503   Panel := TPanel.Create(Self);
    504   with Panel do begin
    505     Parent := Self;
    506     Caption := '';
    507     DockSite := True;
    508     UseDockManager := True;
    509     Align := alClient;
    510     BevelOuter := bvNone;
    511     BevelInner := bvNone;
    512   //  Color := clYellow;
    513   end;
    514499  CoolDockClient := TCoolDockClient.Create(Self);
    515500  with CoolDockClient do begin
    516     Panel := Self.Panel;
    517501  end;
    518502  OnShow := FormShow;
    519503  OnHide := FormHide;
    520 
    521   Panel.AddHandlerOnVisibleChanged(PanelVisibleChange);
    522504end;
    523505
    524506destructor TCoolDockConjoinForm.Destroy;
    525507begin
    526   Panel.RemoveHandlerOnVisibleChanged(PanelVisibleChange);
    527508  inherited;
    528509end;
     
    531512begin
    532513  inherited SetName(NewName);
    533   Panel.Name := Name + 'Panel';
    534   Panel.Caption := '';
    535514  CoolDockClient.Name := Name + 'CoolDockClient';
    536 end;
    537 
    538 procedure TCoolDockConjoinForm.PanelVisibleChange(Sender: TObject);
    539 begin
    540   Visible := Panel.Visible;
    541515end;
    542516
Note: See TracChangeset for help on using the changeset viewer.