Changeset 207 for Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
- Timestamp:
- Mar 18, 2011, 11:05:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/Managers/UCDManagerTabsPopup.pas
r205 r207 55 55 SplitterMouseDrag: Boolean; 56 56 SplitterMousePos: TPoint; 57 procedure PageControlResize(Sender: TObject); 57 58 procedure InsertControlNoUpdate(Control: TControl; InsertAt: TAlign); override; 58 59 procedure SplitterMouseDown(Sender: TObject; Button: TMouseButton; … … 62 63 procedure SplitterMouseUp(Sender: TObject; Button: TMouseButton; 63 64 Shift: TShiftState; X, Y: Integer); 65 procedure UpdatePopupFormBounds; 66 procedure TabControlChange(Sender: TObject); override; 64 67 public 65 68 AutoHideEnabled: Boolean; … … 71 74 procedure PinShowButtonClick(Sender: TObject); 72 75 procedure PinHideButtonClick(Sender: TObject); 73 procedure TabControlChange(Sender: TObject); override;74 76 constructor Create(ADockSite: TWinControl); override; 75 77 destructor Destroy; override; … … 243 245 C.Parent := HeaderPanel.ControlPanel; 244 246 HeaderPanel.Header.Title.Caption := C.Caption; 245 Pos := Point(PageControl.Left, PageControl.Top);246 247 TopParent := DockSite;248 while Assigned(TopParent.Parent) do begin249 Pos.X := Pos.X + TopParent.Left;;250 Pos.Y := Pos.Y + TopParent.Top;251 TopParent := TopParent.Parent;252 end;253 PopupForm.Parent := TopParent;254 247 //AutoHide.Control.Align := alCustom; 255 248 //Pos := DockSite.ClientToScreen(Pos); 256 C.TBDockHeight := 100;257 C.LRDockWidth := 100;258 with AutoHide.Control do259 case AutoHide.TabPosition of260 tpTop: begin261 SetBounds(Pos.X, Pos.Y + PageControl.Height,262 PageControl.Width, C.TBDockHeight);263 end;264 tpLeft: begin265 SetBounds(Pos.X + PageControl.Width, Pos.Y,266 C.LRDockWidth, PageControl.Height);267 end;268 tpBottom: begin269 SetBounds(Pos.X, Pos.Y - C.TBDockHeight,270 PageControl.Width, C.TBDockHeight);271 end;272 tpRight: begin273 SetBounds(Pos.X - C.LRDockWidth, Pos.Y,274 C.LRDockWidth, PageControl.Height);275 end;276 end;277 249 //AutoHide.Control.SetBounds(0, 0, 100, 100); 250 UpdatePopupFormBounds; 278 251 AutoHide.Show; 279 252 end; … … 302 275 AutoHide := TCDAutoHide.Create; 303 276 AutoHide.Control := PopupForm; 277 PageControl.OnResize := PageControlResize; 304 278 305 279 for I := 0 to DockItems.Count - 1 do begin … … 316 290 HeaderPanel.Free; 317 291 inherited Destroy; 292 end; 293 294 procedure TCDManagerTabsPopup.PageControlResize(Sender: TObject); 295 begin 296 UpdatePopupFormBounds; 318 297 end; 319 298 … … 376 355 case Splitter.Align of 377 356 alLeft: begin 378 PopupForm.SetBounds(PopupForm.Left -(X - SplitterMousePos.X),357 PopupForm.SetBounds(PopupForm.Left + (X - SplitterMousePos.X), 379 358 PopupForm.Top, PopupForm.Width - (X - SplitterMousePos.X), 380 359 PopupForm.Height); … … 385 364 end; 386 365 alTop: begin 387 PopupForm.SetBounds(PopupForm.Left, PopupForm.Top + (Y - SplitterMousePos.Y),388 PopupForm.Width, PopupForm.Height +(Y - SplitterMousePos.Y));366 PopupForm.SetBounds(PopupForm.Left, PopupForm.Top + (Y - SplitterMousePos.Y), 367 PopupForm.Width, PopupForm.Height - (Y - SplitterMousePos.Y)); 389 368 end; 390 369 alBottom: begin … … 400 379 begin 401 380 SplitterMouseDrag := False; 381 end; 382 383 procedure TCDManagerTabsPopup.UpdatePopupFormBounds; 384 var 385 Pos: TPoint; 386 C: TControl; 387 TopParent: TWinControl; 388 begin 389 if PageControl.TabIndex <> - 1 then begin 390 Pos := Point(PageControl.Left, PageControl.Top); 391 TopParent := DockSite; 392 while Assigned(TopParent.Parent) do begin 393 Pos.X := Pos.X + TopParent.Left;; 394 Pos.Y := Pos.Y + TopParent.Top; 395 TopParent := TopParent.Parent; 396 end; 397 PopupForm.Parent := TopParent; 398 399 C := TCDManagerTabsPopupItem(DockItems[PageControl.TabIndex]).Control; 400 C.TBDockHeight := 100; 401 C.LRDockWidth := 100; 402 with AutoHide.Control do 403 case AutoHide.TabPosition of 404 tpTop: begin 405 SetBounds(Pos.X, Pos.Y + PageControl.Height, 406 PageControl.Width, C.TBDockHeight); 407 end; 408 tpLeft: begin 409 SetBounds(Pos.X + PageControl.Width, Pos.Y, 410 C.LRDockWidth, PageControl.Height); 411 end; 412 tpBottom: begin 413 SetBounds(Pos.X, Pos.Y - C.TBDockHeight, 414 PageControl.Width, C.TBDockHeight); 415 end; 416 tpRight: begin 417 SetBounds(Pos.X - C.LRDockWidth, Pos.Y, 418 C.LRDockWidth, PageControl.Height); 419 end; 420 end; 421 end; 402 422 end; 403 423 … … 411 431 case AValue of 412 432 hpTop, hpAuto: begin 413 Align := alTop;414 Height := 24;433 //Align := alTop; 434 //Height := 24; 415 435 Splitter.Align := alBottom; 416 436 Splitter.Height := SplitterSize; … … 418 438 end; 419 439 hpBottom: begin 420 Align := alBottom;421 Height := 24;440 //Align := alBottom; 441 //Height := 24; 422 442 Splitter.Align := alTop; 423 443 Splitter.Height := SplitterSize; … … 425 445 end; 426 446 hpLeft: begin 427 Align := alLeft;428 Width := 24;447 //Align := alLeft; 448 //Width := 24; 429 449 Splitter.Align := alRight; 430 450 Splitter.Width := SplitterSize; … … 432 452 end; 433 453 hpRight: begin 434 Align := alRight;435 Width := 24;454 //Align := alRight; 455 //Width := 24; 436 456 Splitter.Align := alLeft; 437 457 Splitter.Width := SplitterSize;
Note:
See TracChangeset
for help on using the changeset viewer.