* * *

Author Topic: [Anchordocking] Which event can use to detect that a form has been docked ?  (Read 439 times)

BBasile

  • Sr. Member
  • ****
  • Posts: 291
Currently I do this in the base form:

Code: Pascal  [Select]
  1. procedure TBaseForm.Resize;
  2. var
  3.   newParent: TWinControl;
  4.   site: TAnchorDockHostSite;
  5. begin
  6.   inherited;
  7.   site := DockMaster.GetAnchorSite(self);
  8.   if site.isNil then
  9.     exit;
  10.   newParent := site.Parent;
  11.   if fOldParent <> newParent then
  12.   begin
  13.     // docking changed...
  14.   end;
  15. end;

While it works, this looks a bit like a workaround: "What does happen when something is docked ? It will certainly be resized so let's override resize()".

Can you propose better ?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus