Changeset 191 for Docking/CoolDocking/UCDManager.pas
- Timestamp:
- Mar 11, 2011, 10:07:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCDManager.pas
r189 r191 7 7 uses 8 8 Classes, SysUtils, UCDCommon, Controls, Contnrs, UCDClientPanel, 9 UCDStyle, UCDPopupMenu, LCLType, LMessages, Graphics, 10 UCDConjoinForm, Menus, StdCtrls, ExtCtrls, Forms, 11 UCDStyleRegions, UCDStyleTabs, UCDStylePopupRegions, 12 UCDStylePopupTabs; 9 UCDPopupMenu, LCLType, LMessages, Graphics, 10 UCDConjoinForm, Menus, StdCtrls, ExtCtrls, Forms; 13 11 14 12 type … … 28 26 FDockPanels: TCDPanels; 29 27 function GetDockSite: TWinControl; 28 function GetDockStyle: TCDStyleType; 30 29 function GetHeaderPos: THeaderPos; 31 30 function GetMoveDuration: Integer; … … 36 35 procedure SetMoveDuration(const AValue: Integer); 37 36 procedure SetVisible(const AValue: Boolean); 38 procedure UpdateClientSize;39 37 public 40 DockStyleHandler: TCDStyle;41 38 PopupMenu: TCDPopupMenu; 42 39 constructor Create(ADockSite: TWinControl); override; 43 40 destructor Destroy; override; 41 procedure UpdateClientSize; virtual; 42 procedure Switch(Index: Integer); virtual; 43 procedure ChangeVisible(Control: TWinControl; Visible: Boolean); virtual; 44 procedure Assign(Source: TCDManager); virtual; 44 45 45 46 // Inherited from TDockManager … … 67 68 function CreateContainer(InsertAt: TAlign): TCDConjoinForm; 68 69 property DockPanels: TCDPanels read FDockPanels write FDockPanels; 69 property DockStyle: TCDStyleType read FDockStyle write SetDockStyle;70 property DockStyle: TCDStyleType read GetDockStyle write SetDockStyle; 70 71 property MoveDuration: Integer read GetMoveDuration write SetMoveDuration; 71 72 property DockSite: TWinControl read GetDockSite; … … 76 77 77 78 implementation 79 80 uses 81 UCDStyleRegions, UCDStyleTabs, UCDStylePopupRegions, UCDStylePopupTabs; 78 82 79 83 { TCDManager } … … 96 100 end; 97 101 102 function TCDManager.GetDockStyle: TCDStyleType; 103 begin 104 if Self is TCDStyleRegions then Result := dsList 105 else if Self is TCDStyleTabs then Result := dsTabs 106 else if Self is TCDStylePopupRegions then Result := dsPopupList 107 else if Self is TCDStylePopupTabs then Result := dsPopupTabs; 108 end; 109 98 110 function TCDManager.GetHeaderPos: THeaderPos; 99 111 begin … … 124 136 begin 125 137 PopupMenu.Free; 126 DockStyleHandler.Free;127 138 FDockPanels.Free; 128 139 inherited Destroy; … … 157 168 DropCtl: TControl); 158 169 begin 159 DockStyleHandler.InsertControl(Control, InsertAt);170 //DockStyleHandler.InsertControl(Control, InsertAt); 160 171 end; 161 172 … … 250 261 ClientPanel: TCDClientPanel; 251 262 begin 252 DockStyleHandler.RemoveControl(Control);263 //DockStyleHandler.RemoveControl(Control); 253 264 //inherited; 254 265 (* if Control.HostDockSite = Self.FDockSite then begin … … 309 320 var 310 321 I: Integer; 322 NewManager: TCDManager; 311 323 begin 312 324 if FDockStyle <> AValue then begin 313 325 FDockStyle := AValue; 314 FreeAndNil(DockStyleHandler);315 326 if AValue = dsTabs then begin 316 DockStyleHandler := TCDStyleTabs.Create(Self);317 TCDStyleTabs( DockStyleHandler).TabControlChange(Self);327 NewManager := TCDStyleTabs.Create(Self); 328 TCDStyleTabs(Self).TabControlChange(Self); 318 329 end else 319 330 if AValue = dsList then begin 320 DockStyleHandler := TCDStyleRegions.Create(Self);331 NewManager := TCDStyleRegions.Create(Self); 321 332 end else 322 333 if AValue = dsPopupList then begin 323 DockStyleHandler := TCDStylePopupRegions.Create(Self);334 NewManager := TCDStylePopupRegions.Create(Self); 324 335 end else 325 336 if AValue = dsPopupTabs then begin 326 DockStyleHandler := TCDStylePopupTabs.Create(Self); 327 end; 337 NewManager := TCDStylePopupTabs.Create(Self); 338 end; 339 if DockSite.DockManager is TCDManager then 340 NewManager.Assign(TCDManager(DockSite.DockManager)); 341 DockSite.DockManager := NewManager; 328 342 end; 329 343 UpdateClientSize; … … 343 357 I: Integer; 344 358 begin 345 DockStyleHandler.Visible := AValue;359 Visible := AValue; 346 360 // for I := 0 to DockPanels.Count - 1 do 347 361 // TCDClientPanel(DockPanels[I]).Visible := AValue; … … 350 364 procedure TCDManager.UpdateClientSize; 351 365 begin 352 DockStyleHandler.UpdateClientSize; 366 // DockStyleHandler.UpdateClientSize; 367 end; 368 369 procedure TCDManager.Switch(Index: Integer); 370 begin 371 372 end; 373 374 procedure TCDManager.ChangeVisible(Control: TWinControl; Visible: Boolean); 375 begin 376 377 end; 378 379 procedure TCDManager.Assign(Source: TCDManager); 380 begin 381 FDockStyle := Source.FDockStyle; 382 FDockSite := Source.FDockSite; 353 383 end; 354 384
Note:
See TracChangeset
for help on using the changeset viewer.