Howdy, Stranger!

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

In this Discussion

Make a new Dock Panel visible?

I added a new dkTool TLMDDockPanel to our application, and in design mode I set it up docked as a tabbed panel with another dock panel.

Users may have saved various dock panel layouts via the DockManager, so it is not visible in their custom layout even though PanelVisible is true for that new panel.  If they don't load one of their saved layouts, it is fine.  So, my question is how can I make it show up if they loaded one of their saved layouts so that they don't have to revert to the "as designed" layout and redo all their saved layouts?

If I look at the XML in the layout where it is not shown, it is not even in the markup, but is in the case where it is visible.

Not visible:
<zone kind="PANEL" id="frmWhisperReporter.pnlRapidRemarks" visible="1" size="162" dsize="0.11088295687885"/>

Visible:
<zone kind="TABS" activetab="1" size="162" dsize="0.11088295687885">
<zone kind="PANEL" id="frmWhisperReporter.pnlRapidRemarks" visible="1"/>
<zone kind="PANEL" id="frmWhisperReporter.dkpAllImages" visible="1"/>
</zone>


I guess I need to know the basics on how to add a zone of kind zkTabs and add the existing pnlRapidRemarks and the missing (but existing) dkpAllImages to it.  But only if dkpAllImages is not in the layout to begin with.

If not possible or not easy to do, I'll just have everyone re-do their saved layouts.  I only have a few people beta testing my app, so it's not the end of the world.

Eric

Comments

  • 4 Comments sorted by Votes Date Added
  • You can do either:

    - Dock new panel somewhere using Site.DockControl method
    - Or show new panel as a floating panel using Panel.ManualFloat method.
  • Thanks, the DockControl works nicely, however, I don't want to dock it if the user has already done something with it and has been made visible and part of the custom layout.  Is this the correct way to know if the new panel is a new panel that won't be visible?  Basically I do this after a LMDDockManager1.LoadFromStream of a custom layout that might or might not have the new dkpAllImages panel configure into the layout:

      if (dkpAllImages.Site = nil) or (dkpAllImages.Site.Owner = nil) then
         LMDDockSite1.DockControl(dkpAllImages, pnlRapidRemarks.Zone, alClient, 1, false);

    It seems to do the job perfectly, just wanted to be sure it is not just a hack.
  • No special function is provided, so your way is ok. Alternatively, there is a Panel.Zone property, which you can test for nil.
  • Thanks, I missed that one.  I like your way better.
Sign In or Register to comment.