Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDDockManager conflict or modal form issue?

I use a Dock Manager on my main form (saves layouts to a location).  I also use another Dock Manager on a separate modal form (saves layouts to a different location).  The modal form is an image editor that I can also compile standalone as its own application via conditional compilation.

When I run it standalone and save the layout, it properly saves floating panels.  However, if I execute the same code when a modal form of my main program, it does not save floating panels to the XML file.  If it is not floating, it works fine.  Is there a conflict in such a scenario, or is there a problem with the dock manager when used in a modal form?

When run standalone:

<?xml version="1.0" encoding="utf-8"?>
<sitelist>
<site dpi="96" floating="1" left="2125" top="915" width="216" height="454">
<zone kind="PANEL" id="frmImageEditor.dkpImageObjects" visible="1"/>
</site>
<site dpi="96" id="frmImageEditor.LMDDockSite1">
<zone kind="HORZ">
<zone kind="PANEL" id="frmImageEditor.dkpLayerProperties" visible="1" size="237" dsize="0.165156794425087"/>
<zone kind="TABS" activetab="0" size="983" dsize="0.685017421602787" isspace="1">
<zone kind="PANEL" id="frmImageEditor.dkpLayerWorkspace" visible="1"/>
</zone>
<zone kind="PANEL" id="frmImageEditor.dkpImageLayers" visible="1" size="215" dsize="0.149825783972125"/>
</zone>
</site>
</sitelist>


When run as a modal form to another application (notice the missing floating panel):

<?xml version="1.0" encoding="utf-8"?>
<sitelist>
<site dpi="96" id="frmImageEditor.LMDDockSite1">
<zone kind="HORZ">
<zone kind="PANEL" id="frmImageEditor.dkpLayerProperties" visible="1" size="237" dsize="0.165156794425087"/>
<zone kind="TABS" activetab="0" size="983" dsize="0.685017421602787" isspace="1">
<zone kind="PANEL" id="frmImageEditor.dkpLayerWorkspace" visible="1"/>
</zone>
<zone kind="PANEL" id="frmImageEditor.dkpImageLayers" visible="1" size="215" dsize="0.149825783972125"/>
</zone>
</site>
</sitelist>


LMDTools 2019.9
Delphi 10.3.2

Comments

  • 4 Comments sorted by Votes Date Added
  • If several instances of TLMDDockManager exist in application you sohuld choose, which dock manager should belong to newly created floating sites (forms), using OnAttachFloatingSite events.
  • Thanks... seems all I have to do to save properly is to add this in the AttachFloatingSite event on the Modal form:
    Attach := true;

    I didn't realize until now that I can dock a modal form's floating dockpanel to my main app's docksite (which is way cool).  Nice to know this now so I can try to prevent this as I don't want a user to move any of my modal form's dockpanels to my main app's docksite because they go away once you close the modal form.
  • I just now saw this post from a few years ago.  Don't know how I missed it and provides a nice explanation:

  • Yes. Floating panel (or floating form consisting of several panels, docked into it) no longer belong to some of previous dock sites. Actually, any floating form creates an implicit docking site inside it. And so, this site need to be somehow associated with one or another dock manager. Given the fact that floating form can contain several panels it may become tricky. And so, we suggest NOT to use several dock managers generally.

    Association with dock manager affects not only saving, but also a styling (if you use different styles in diferent managers), and some other minor aspects.
Sign In or Register to comment.