SaveState and LoadState |
Post Reply |
Author | |
Carlos Rocha
Groupie Joined: 11 February 2008 Location: Portugal Status: Offline Points: 92 |
Post Options
Thanks(0)
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 |
|
pate
Groupie Joined: 27 April 2009 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
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. |
|
Carlos Rocha
Groupie Joined: 11 February 2008 Location: Portugal Status: Offline Points: 92 |
Post Options
Thanks(0)
|
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 |
|
pate
Groupie Joined: 27 April 2009 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
<<<<<
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.
|
|
Carlos Rocha
Groupie Joined: 11 February 2008 Location: Portugal Status: Offline Points: 92 |
Post Options
Thanks(0)
|
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 |
|
pate
Groupie Joined: 27 April 2009 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
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.
|
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |