Ignore:
Timestamp:
Mar 11, 2011, 2:16:50 PM (14 years ago)
Author:
george
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Docking/CoolDocking/UCDManager.pas

    r194 r195  
    3333  end;
    3434
    35   { TCDManagerItem }
    36 
    37   TCDManagerItem = class
     35  { TCDPanelHeader }
     36
     37  TCDPanelHeader = class(TPanel)
    3838  private
    3939    FHeaderPos: THeaderPos;
    4040    FShowHeader: Boolean;
     41    procedure SetHeaderPos(const AValue: THeaderPos);
     42  public
     43    Header: TCDHeader;
     44    ControlPanel: TPanel;
     45    property ShowHeader: Boolean read FShowHeader write FShowHeader;
     46    property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos;
     47    constructor Create(TheOwner: TComponent);
     48    destructor Destroy; override;
     49  end;
     50
     51  { TCDManagerItem }
     52
     53  TCDManagerItem = class
     54  private
    4155    procedure DockPanelMouseDown(Sender: TObject; Button: TMouseButton;
    4256      Shift: TShiftState; X, Y: Integer);
    4357    procedure ResizeExecute(Sender: TObject);
    44     procedure SetHeaderPos(const AValue: THeaderPos);
    4558  public
    46     Header: TCDHeader;
    4759    Control: TControl;
    4860    Manager: TCDManager;
     
    5163    constructor Create;
    5264    destructor Destroy; override;
    53     property ShowHeader: Boolean read FShowHeader write FShowHeader;
    54     property HeaderPos: THeaderPos read FHeaderPos write SetHeaderPos;
    5565  end;
    5666
     
    116126  UCDManagerRegions, UCDManagerTabs, UCDManagerRegionsPopup, UCDManagerTabsPopup;
    117127
    118 { TCDManagerItem }
    119 
    120 procedure TCDManagerItem.SetHeaderPos(const AValue: THeaderPos);
     128{ TCDPanelHeader }
     129
     130procedure TCDPanelHeader.SetHeaderPos(const AValue: THeaderPos);
    121131begin
    122132  if FHeaderPos=AValue then exit;
    123133  FHeaderPos:=AValue;
    124   Paint(Self);
    125 end;
     134  //Paint(Self);
     135end;
     136
     137constructor TCDPanelHeader.Create(TheOwner: TComponent);
     138begin
     139  inherited;
     140  //Paint.OnPaint := Paint;
     141//  Header.Shape.OnMouseDown := DockPanelMouseDown;
     142//  Header.Title.OnMouseDown := DockPanelMouseDown;
     143  HeaderPos := hpTop;
     144
     145  ShowHeader := True;
     146  ControlPanel := TPanel.Create(Self);
     147  with ControlPanel do begin
     148    Parent := Self;
     149    Visible := True;
     150    DockSite := True;
     151    UseDockManager := True;
     152    Align := alClient;
     153    BevelInner := bvNone;
     154    BevelOuter := bvNone;
     155    //Color := clGreen;
     156  end;
     157  Header := TCDHeader.Create(Self);
     158  with Header do begin
     159    Parent := Self;
     160    Visible := ShowHeader;
     161    Align := alTop;
     162    Height := GrabberSize;
     163    //ManagerItem := Self;
     164  end;
     165  //OnResize := ResizeExecute;
     166  BevelInner := bvNone;
     167  BevelOuter := bvNone;
     168end;
     169
     170destructor TCDPanelHeader.Destroy;
     171begin
     172  inherited Destroy;
     173end;
     174
     175{ TCDManagerItem }
    126176
    127177procedure TCDManagerItem.Paint(Sender: TObject);
     
    145195constructor TCDManagerItem.Create;
    146196begin
    147   //Paint.OnPaint := Paint;
    148   Header.Shape.OnMouseDown := DockPanelMouseDown;
    149   Header.Title.OnMouseDown := DockPanelMouseDown;
    150   //OnResize := ResizeExecute;
    151   //BevelInner := bvNone;
    152   //BevelOuter := bvNone;
    153   HeaderPos := hpTop;
    154 
    155   ShowHeader := True;
    156   Header := TCDHeader.Create(nil);
    157   with Header do begin
    158     Parent := nil;
    159     Visible := ShowHeader;
    160     Align := alTop;
    161     Height := GrabberSize;
    162     ManagerItem := Self;
    163   end;
    164197end;
    165198
     
    457490    if AValue = dsTabs then begin
    458491      NewManager := TCDManagerTabs.Create(FDockSite);
    459       //TCDManagerTabs(Self).TabControlChange(Self);
    460492    end else
    461493    if AValue = dsList then begin
Note: See TracChangeset for help on using the changeset viewer.