Ignore:
Timestamp:
Mar 22, 2011, 9:49:17 AM (14 years ago)
Author:
george
Message:
  • Added: ConjoinForms caption update.
  • Fixed: Docking new clients to TCDManagerRegions in different direction create new sub conjoin form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCDManager.pas

    r215 r216  
    3838    Icon: TImage;
    3939    ManagerItem: TCDManagerItem;
    40     procedure DrawGrabber(Canvas: TCanvas; AControl: TControl);
    4140    constructor Create(TheOwner: TComponent); override;
    4241    destructor Destroy; override;
     
    9695    PopupMenu: TCDPopupMenu;
    9796    FDockStyle: TCDStyleType;
     97    FreeParentIfEmpty: Boolean; // Free or not parent conjoin forms
    9898    constructor Create(ADockSite: TWinControl); override;
    9999    destructor Destroy; override;
     
    325325  FDockSite := ADockSite;
    326326
     327  FreeParentIfEmpty := True;
     328
    327329  FDockStyle := dsList; // dsNone
    328330  FHeaderVisible := True;
     
    389391      FDockSite.ManualDock(NewConjoinDockForm);
    390392      Control.ManualDock(NewConjoinDockForm, nil, InsertAt);
     393      NewConjoinDockForm.UpdateCaption;
    391394    end else begin
    392395      NewConjoinDockForm := CreateContainer(InsertAt);
     
    396399      FDockSite.ManualDock(NewConjoinDockForm);
    397400      Control.ManualDock(NewConjoinDockForm, nil, InsertAt);
     401      NewConjoinDockForm.UpdateCaption;
    398402    end;
    399403  end else
     
    401405    InsertControlPanel(Control, InsertAt, DropCtl);
    402406  end;
     407  if FDockSite is TCDConjoinForm then
     408    TCDConjoinForm(FDockSite).UpdateCaption;
    403409
    404410//  FDockPanel.Invalidate;
     
    451457procedure TCDManager.RemoveControl(Control: TControl);
    452458begin
     459  if FDockSite is TCDConjoinForm then
     460    TCDConjoinForm(FDockSite).UpdateCaption;
    453461end;
    454462
     
    625633end;
    626634
    627 procedure TCDHeader.DrawGrabber(Canvas: TCanvas; AControl: TControl);
    628 begin
    629   with Canvas do begin
    630     Brush.Color := clBtnFace;
    631     Pen.Color := clBlack;
    632     //FillRect(0, 0, AControl.Width, GrabberSize);
    633 
    634     if (AControl as TWinControl).Focused then
    635       Title.Font.Style := Font.Style + [fsBold]
    636       else Title.Font.Style := Font.Style - [fsBold];
    637     Rectangle(1, 1, AControl.Width - 1, GrabberSize - 1);
    638     if Icon.Picture.Width > 0 then Title.Left := 8 + Icon.Picture.Width
    639       else Title.Left := 6;
    640     Title.Caption := AControl.Caption;
    641     RearrangeButtons;
    642   end;
    643 end;
    644 
    645635procedure TCDHeader.PaintExecute(Sender: TObject);
    646636const
     
    653643  Points: array of TPoint;
    654644begin
     645  if (ManagerItem.Control as TWinControl).Focused then
     646  Title.Font.Style := Font.Style + [fsBold]
     647  else Title.Font.Style := Font.Style - [fsBold];
     648
     649  if Icon.Picture.Width > 0 then Title.Left := 8 + Icon.Picture.Width
     650    else Title.Left := 6;
     651  Title.Caption := ManagerItem.Control.Caption;
     652  RearrangeButtons;
     653
    655654  with Canvas do begin
    656655    GradientFill(Rect(Border, Border, Width - Border,
Note: See TracChangeset for help on using the changeset viewer.