Changeset 198 for Docking/CoolDocking/Managers/UCDManagerTabs.pas
- Timestamp:
- Mar 16, 2011, 12:32:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerTabs.pas
r195 r198 16 16 TCDManagerTabsItem = class(TCDManagerItem) 17 17 Icon: TImage; 18 constructor Create; 18 constructor Create; override; 19 19 destructor Destroy; override; 20 20 end; … … 23 23 24 24 TCDManagerTabs = class(TCDManager) 25 p ublic25 private 26 26 MouseDown: Boolean; 27 27 MouseButton: TMouseButton; 28 28 MouseDownSkip: Boolean; 29 PageControl: TPageControl;30 TabImageList: TImageList;31 29 FDockItems: TObjectList; // TList<TCDManagerRegionsItem> 32 30 procedure TabControlMouseLeave(Sender: TObject); 33 procedure TabControlChange(Sender: TObject);34 31 procedure TabControlMouseDown(Sender: TObject; Button: TMouseButton; 35 32 Shift: TShiftState; X, Y: Integer); … … 39 36 DropCtl: TControl); override; 40 37 procedure UpdateClientSize; override; 41 private42 FTabsPos: THeaderPos;43 38 function FindControlInPanels(Control: TControl): TCDManagerItem; override; 44 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign);45 39 procedure RemoveControl(Control: TControl); override; 40 function GetHeaderPos: THeaderPos; override; 41 procedure SetHeaderPos(const AValue: THeaderPos); override; 46 42 public 47 constructor Create(ADockSite: TWinControl); 43 TabImageList: TImageList; 44 PageControl: TPageControl; 45 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); virtual; 46 procedure TabControlChange(Sender: TObject); virtual; 47 constructor Create(ADockSite: TWinControl); override; 48 48 destructor Destroy; override; 49 49 procedure PaintSite(DC: HDC); override; … … 51 51 procedure ChangeVisible(Control: TWinControl; Visible: Boolean); override; 52 52 procedure Switch(Index: Integer); override; 53 procedure SetTabsPos(const AValue: THeaderPos);54 53 procedure PopupMenuTabCloseClick(Sender: TObject); 55 property TabsPos: THeaderPos read FTabsPos write SetTabsPos;56 54 property DockItems: TObjectList read FDockItems write FDockItems; 57 55 end; … … 98 96 begin 99 97 if MouseDown then 100 if Assigned(PageControl.ActivePage) then begin98 if Assigned(PageControl.ActivePage) and not Locked then begin 101 99 //TCDManagerItem(DockItems[PageControl.TabIndex]).ClientAreaPanel.DockSite := False; 102 100 DragManager.DragStart(TCDManagerItem(DockItems[PageControl.TabIndex]).Control, False, 1); … … 188 186 TabImageList := TImageList.Create(ADockSite); //FDockSite); 189 187 with TabImageList do begin 190 Name := DockSite.Name + 'ImageList';188 Name := GetUniqueName(DockSite.Name + 'ImageList'); 191 189 end; 192 190 PageControl := TPageControl.Create(ADockSite); //FDockSite); 193 191 with PageControl do begin 194 192 Parent := ADockSite; 195 Name := Self.DockSite.Name + 'TabControl';193 Name := GetUniqueName(Self.DockSite.Name + 'TabControl'); 196 194 Visible := True; 197 195 //Align := alTop; … … 216 214 for I := 0 to ADockSite.DockClientCount - 1 do 217 215 InsertControlNoUpdate(ADockSite.DockClients[I], alNone); 218 TabControlChange(Self);216 //TabControlChange(Self); 219 217 //TCDManagerTabs(Self).TabControlChange(Self); 220 218 end; … … 287 285 begin 288 286 inherited RemoveControl(Control); 287 end; 288 289 function TCDManagerTabs.GetHeaderPos: THeaderPos; 290 begin 291 Result := inherited; 292 end; 293 294 procedure TCDManagerTabs.SetHeaderPos(const AValue: THeaderPos); 295 begin 296 inherited SetHeaderPos(AValue); 297 with PageControl do 298 case AValue of 299 hpAuto, hpTop: begin 300 //Align := alTop; 301 TabPosition := tpTop; 302 Height := GrabberSize; 303 end; 304 hpLeft: begin 305 //Align := alLeft; 306 TabPosition := tpLeft; 307 Width := GrabberSize; 308 end; 309 hpRight: begin 310 //Align := alRight; 311 TabPosition := tpRight; 312 Width := GrabberSize; 313 end; 314 hpBottom: begin 315 //Align := alBottom; 316 TabPosition := tpBottom; 317 Height := GrabberSize; 318 end; 319 end; 289 320 end; 290 321 … … 376 407 end; 377 408 378 procedure TCDManagerTabs.SetTabsPos(const AValue: THeaderPos);379 begin380 if FTabsPos = AValue then Exit;381 FTabsPos := AValue;382 with PageControl do383 case AValue of384 hpAuto, hpTop: begin385 Align := alTop;386 TabPosition := tpTop;387 Height := GrabberSize;388 end;389 hpLeft: begin390 Align := alLeft;391 TabPosition := tpLeft;392 Width := GrabberSize;393 end;394 hpRight: begin395 Align := alRight;396 TabPosition := tpRight;397 Width := GrabberSize;398 end;399 hpBottom: begin400 Align := alBottom;401 TabPosition := tpBottom;402 Height := GrabberSize;403 end;404 end;405 end;406 407 408 409 end. 409 410
Note:
See TracChangeset
for help on using the changeset viewer.