Print Page | Close Window

Floating Pane shrink to fit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=9920
Printed Date: 30 June 2024 at 1:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Floating Pane shrink to fit
Posted By: fawcettp
Subject: Floating Pane shrink to fit
Date Posted: 18 March 2008 at 10:34am
Is it possible to get a pane to shrink to it's child form (the form to which it is attached via the Handle attribute) when it is detached from a DockingPaneManager?
 
I've tried to set the Min and Max track values in the action event for the Docking pane manager when the pane is floated but this has no effect.
 
I'm trying to get the panes to resize to minimise the amount of screen space they take up when detached so any assistance would be appreciated. I would have thought this behaviour would be configurable but haven't been able to find anything so far.
 
Thanks.
 



Replies:
Posted By: znakeeye
Date Posted: 29 March 2008 at 11:37pm
I need this too!!


Posted By: Aaron
Date Posted: 31 March 2008 at 6:21am
Hi, 
 
The properties MinTrackSize and MaxTrackSize should do the trick
 
DockingPane.FindPane(1).MinTrackSize.SetSize 100, 100
DockingPane.FindPane(1).MaxTrackSize.SetSize 100, 100
(This will also prevent the pane from getting resized as well)
 
When MinTrackSize and MaxTrackSize are set to a value the floating pane will be resized to this value otherwise you have to set left,top,right,bottom in the FloatPane method.
 
DockingPane.FloatPane DockingPane.FindPane(1), 0, 0, 0, 0
(Where 1 is the Pane ID)
 
Or in the DP Action event:
 
If Action = PaneActionFloated Then
        DockingPane.Options.ThemedFloatingPanes = False 'huhhhh ????? 
        Pane.MinTrackSize.SetSize 200, 100
        Pane.MaxTrackSize.SetSize 200, 100
        DockingPane.Options.ThemedFloatingPanes = True 'huhhhh ????? 
        DockingPane.RedrawPanes 'resize contents
End If
 
If Action = PaneActionDocked Then
        Pane.MinTrackSize.SetSize 300, 300
        Pane.MaxTrackSize.SetSize 800, 300
End If 
 
Note: the 'huhhhh ????? means that this must be set first otherwise the pane won't be resized to Min and MaxTrackSize. If you don't use ThemedFloatingPanes you don't have to add these lines of code. There are a few buts...
 
  https://forum.codejock.com/uploads/20080401_015004_TestDockingPane.zip - uploads/20080401_015004_TestDockingPane.zip


Posted By: fawcettp
Date Posted: 01 April 2008 at 11:36am
I've tracked the problem down to one of the options on the DockingPaneManager. I had ThemedFloatingFrames = true which causes the observed behaviour i.e panel size doesn't change when the pane is undocked.
Setting ThemedFloatingFrames = false does cause the panel to shrink to the size of the wrapped window. However, in this case, the window style doesn't match the other windows. I've managed to find a workaround but I'm surprised this option gives functional differences rather than just a difference in appearance.
 


Posted By: Aaron
Date Posted: 01 April 2008 at 12:47pm
Hi,
 
That's what I said, look at the 'huhhhh ????? note. You don't have to workaround that, CodeJock will fix this in the final V12 release. So be patience my son



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net