Alright, I have taken the time to delve further into the unfortunately not so well documented code and did the following for each point:
1:I made a new class inheriting from TAnchorDockHostSite and extended the SetParent method to fire events through the control hierarchy.
type
TALEEditorDockHostSite = class(TAnchorDockHostSite)
protected
FOnParentChange: TNotifyEvent;
FOnParentChanged: TNotifyEvent;
procedure SetParent(NewParent: TWinControl); override;
procedure NotifyParentChange(Source: TComponent);
procedure NotifyParentChanged(Source: TComponent);
public
property OnParentChange: TNotifyEvent read FOnParentChange write FOnParentChange;
property OnParentChanged: TNotifyEvent read FOnParentChanged write FOnParentChanged;
end;
procedure TALEEditorDockHostSite.SetParent(NewParent: TWinControl);
begin
NotifyParentChange(Self);
inherited SetParent(NewParent);
NotifyParentChanged(Self);
end;
procedure TALEEditorDockHostSite.NotifyParentChange(Source: TComponent);
var
Index: ValSInt;
begin
if Assigned(FOnParentChange) then
FOnParentChange(Source);
for Index := 0 to ControlCount - 1 do
if Controls[Index] is TALEEditorDockHostSite then
(Controls[Index] as TALEEditorDockHostSite).NotifyParentChange(Source);
end;
procedure TALEEditorDockHostSite.NotifyParentChanged(Source: TComponent);
var
Index: ValSInt;
begin
if Assigned(FOnParentChanged) then
FOnParentChanged(Source);
for Index := 0 to ControlCount - 1 do
if Controls[Index] is TALEEditorDockHostSite then
(Controls[Index] as TALEEditorDockHostSite).NotifyParentChanged(Source);
end;
After that I told DockMaster in my app's initialization to instanciate this class instead of the default TAnchorDockHostSite:
DockMaster.SiteClass := TALEEditorDockHostSite;
2:Yet to be solved. Will edit once I have it. Probably similar to the above solution.
3:Instead of making my entire main for a dock site via MakeDockSite I instead switched over to give it a dedicated docking area and made this the dock site instead via MakeDockPanel.
That is from the minidewithdockpanel example files. It also prevents resizing problems when closing docket forms (some other forms may become almost entirely hidden, confusing for the end-user).