Ignore:
Timestamp:
Mar 18, 2011, 11:05:39 AM (14 years ago)
Author:
george
Message:
  • Fixed: PopupForm auto resize on parent resize.
  • Added: Option in popup menu for change visibility of dock panel header.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCDManager.pas

    r199 r207  
    4848  private
    4949    FHeaderPos: THeaderPos;
    50     FShowHeader: Boolean;
     50    function GetHeaderVisible: Boolean;
    5151    procedure SetHeaderPos(const AValue: THeaderPos);
     52    procedure SetHeaderVisible(const AValue: Boolean);
    5253  public
    5354    Header: TCDHeader;
    5455    ControlPanel: TPanel;
    55     property ShowHeader: Boolean read FShowHeader write FShowHeader;
    5656    property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos;
     57    property HeaderVisible: Boolean read GetHeaderVisible write SetHeaderVisible;
    5758    constructor Create(TheOwner: TComponent);
    5859    destructor Destroy; override;
     
    8182    FDockSite: TWinControl;
    8283    FHeaderPos: THeaderPos;
     84    FHeaderVisible: Boolean;
    8385    function GetDockSite: TWinControl;
    8486    function GetMoveDuration: Integer;
    8587    procedure SetDockStyle(const AValue: TCDStyleType);
     88    procedure SetHeaderVisible(const AValue: Boolean);
    8689    procedure SetMoveDuration(const AValue: Integer);
    8790    procedure SetVisible(const AValue: Boolean);
     
    129132    property DockSite: TWinControl read GetDockSite;
    130133    property HeaderPos: THeaderPos read GetHeaderPos write SetHeaderPos;
     134    property HeaderVisible: Boolean read FHeaderVisible write SetHeaderVisible;
    131135    property Visible: Boolean write SetVisible;
    132136  end;
     
    173177  FHeaderPos:=AValue;
    174178  //Paint(Self);
     179end;
     180
     181function TCDPanelHeader.GetHeaderVisible: Boolean;
     182begin
     183  Result := Header.Visible;
     184end;
     185
     186procedure TCDPanelHeader.SetHeaderVisible(const AValue: Boolean);
     187begin
     188  Header.Visible := AValue;
    175189end;
    176190
     
    185199  Align := alClient;
    186200
    187   ShowHeader := True;
    188201  ControlPanel := TPanel.Create(Self);
    189202  with ControlPanel do begin
     
    200213  with Header do begin
    201214    Parent := Self;
    202     Visible := ShowHeader;
     215    Visible := True;
    203216    Align := alTop;
    204217    Height := GrabberSize;
     
    208221  //BevelInner := bvNone;
    209222  //BevelOuter := bvNone;
     223  HeaderVisible := True;
    210224end;
    211225
     
    330344
    331345  FDockStyle := dsList; // dsNone
     346  FHeaderVisible := True;
    332347  PopupMenu := TCDPopupMenu.Create(Self);
    333348  PopupMenu.Parent := ADockSite;
     
    536551    NewManager.UpdateClientSize;
    537552  end;
     553end;
     554
     555procedure TCDManager.SetHeaderVisible(const AValue: Boolean);
     556begin
     557  if FHeaderVisible = AValue then Exit;
     558  FHeaderVisible := AValue;
     559  if Assigned(DockSite.HostDockSite) then
     560    TCDManager(DockSite.HostDockSite.DockManager).UpdateClientSize;
    538561end;
    539562
Note: See TracChangeset for help on using the changeset viewer.