Changeset 183 for Docking/CoolDocking/UCoolDocking.pas
- Timestamp:
- Mar 10, 2011, 7:55:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDocking.pas
r182 r183 19 19 20 20 type 21 TDockDirection = (ddNone, ddHorizontal, ddVertical);22 23 21 TCoolDockManager = class; 24 22 TCoolDockClient = class; … … 54 52 FMaster: TCoolDockMaster; 55 53 FDockStyle: TDockStyle; 56 FDockDirection: TDockDirection;57 54 FDockSite: TWinControl; 58 55 FDockPanels: TCoolDockPanels; … … 104 101 property HeaderPos: THeaderPos read GetHeaderPos write SetHeaderPos; 105 102 property Visible: Boolean write SetVisible; 106 property DockDirection: TDockDirection read FDockDirection107 write FDockDirection;108 103 end; 109 104 … … 277 272 procedure TCoolDockManager.InsertControlPanel(Control: TControl; InsertAt: TAlign; 278 273 DropCtl: TControl); 279 var 280 NewPanel: TCoolDockClientPanel; 281 I: Integer; 282 begin 283 if FDockSite.DockClientCount = 2 then begin 284 if (InsertAt = alTop) or (InsertAt = alBottom) then 285 FDockDirection := ddVertical 286 else 287 if (InsertAt = alLeft) or (InsertAt = alRight) then 288 FDockDirection := ddHorizontal 289 else FDockDirection := ddHorizontal; 290 end;// else FDockSite.DockClientCount > 2 then begin 291 292 //end; 293 if FDockSite.DockClientCount > 1 then begin 294 with TCoolDockClientPanel(FDockPanels.Last).Splitter do begin 295 Parent := FDockSite; 296 Visible := (DockStyle = dsList); 297 if FDockDirection = ddVertical then begin 298 Align := alTop; 299 Top := FDockSite.Height; 300 end else 301 if FDockDirection = ddHorizontal then begin 302 Align := alLeft; 303 Left := FDockSite.Width; 304 end; 305 end; 306 307 with TCoolDockClientPanel(FDockPanels.Last) do 308 if FDockDirection = ddVertical then 309 Align := alTop 310 else 311 if FDockDirection = ddHorizontal then 312 Align := alLeft; 313 end; 314 NewPanel := TCoolDockClientPanel.Create(nil); 315 with NewPanel do begin 316 Parent := FDockSite; 317 OwnerDockManager := Self; 318 if DockStyle = dsList then Visible := True; 319 Align := alClient; 320 Header.PopupMenu := Self.PopupMenu; 321 //PopupMenu.Parent := Self.DockSite; 322 end; 323 if (Control is TForm) and Assigned((Control as TForm).Icon) then 324 NewPanel.Header.Icon.Picture.Assign((Control as TForm).Icon); 325 326 DockStyleHandler.InsertControl(NewPanel, Control, InsertAt); 327 328 NewPanel.Control := Control; 329 Control.AddHandlerOnVisibleChanged(NewPanel.VisibleChange); 330 Control.Parent := NewPanel.ClientAreaPanel; 331 Control.Align := alClient; 332 if (InsertAt = alTop) or (InsertAt = alLeft) then 333 FDockPanels.Insert(0, NewPanel) 334 else FDockPanels.Add(NewPanel); 335 UpdateClientSize; 274 begin 275 DockStyleHandler.InsertControl(Control, InsertAt); 336 276 end; 337 277 … … 433 373 //Control.RemoveHandlerOnVisibleChanged(ClientPanel.VisibleChange); 434 374 FDockPanels.Remove(ClientPanel); 435 if FDockSite.DockClientCount = 2 then FDockDirection := ddNone;375 DockStyleHandler.RemoveControl(Control); 436 376 UpdateClientSize; 437 377 //FDockSite.Invalidate;
Note:
See TracChangeset
for help on using the changeset viewer.