Print Page | Close Window

SaveState and LoadState

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=16610
Printed Date: 06 October 2024 at 5:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SaveState and LoadState
Posted By: Carlos Rocha
Subject: SaveState and LoadState
Date Posted: 19 April 2010 at 1:17am
Hi,

I want to save user layout preferences in a database to use in the next program execution. For this I'm saving the result of SaveLayoutToString.

In the next execution the initial layout is the original, and then I call LoadLayoutFromString. The layout changes like expected, but with empty panes. When I try to reassign the handles the program crashes.

Does this have a solution, or do I have to parse the XML and use the relevant values in the CreatePane method?




-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8



Replies:
Posted By: pate
Date Posted: 11 May 2010 at 1:11pm
That's the way I do it, after I load the Layout from string, the first thing I do is set the handles of the container controls:
 
For J = 1 To .PanesCount
        DockingPaneManager.Panes(J).SetHandle Elastic(J).hwnd
Next J
    
then set some other stuff like titles, colors, and pane options.


Posted By: Carlos Rocha
Date Posted: 11 May 2010 at 4:46pm
Thank you for pulling in

But I'm not sure if I understand you. Do you re-assign the handles after LoadLayoutFromString, or the first thing you do is loading the layout and only then assign the handles (didn't try this yet)?

-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8


Posted By: pate
Date Posted: 11 May 2010 at 4:56pm
<<<<<
Do you re-assign the handles after LoadLayoutFromString, or the first thing you do is loading the layout and only then assign the handles
>>>>>
Not sure I understand your question, aren't these two the same thing?  Each pane has a container control.  After I do ANY Load from string, I have to assign the handles whether it is the first time thru, or if the user is loading in a different layout.


Posted By: Carlos Rocha
Date Posted: 11 May 2010 at 5:44pm
In my case if I load a layout AFTER assigning the handles the panes become empty, and if I assign again the handles the program crash.
I presume you can (re)assign the handles at any time, right?

-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8


Posted By: pate
Date Posted: 11 May 2010 at 6:02pm
Yes, I have no problem reassigning them multiple times.  Using VB6 SP6, and picture boxes as the container controls.  I have several preset layouts that the user can load from string.  Each time, it loads the layout, then I assign the handles to the panes, then set the titles, color, and pane options.  I've never seen it crash, so I assume it is very possible to do.


Posted By: Baldur
Date Posted: 14 May 2010 at 4:52am
You have first define the layout by LoadLayoutxxx.
If LoadLayou doesn't create panes, you can create a default-layout.
 
To attach the panes, you have to use the DockingPane_AttachPane-Event.
Depending on the associated Item.Id-Property you can than create and attach the corresponding forms/pictureboxes.
Define a unique Id for the type of pane.
 
The reason is, that LoadLayout destroyes all prevoius created panes and create new panes on the loaded layout.



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