Change layouts dinamically

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

Change layouts dinamically

Postby francesco78 » Tue Oct 16, 2007 3:17 am

Hello everybody,
I'm developing an application that uses a DockableBarDockableHolderPanel with a layout which has been created through Visual Designer. The layout is loaded through the loadInitialLayout method.
Now, I need to change dinamically different layouts on the same panel. That is, all the layouts have been created through Visual Designer and all of them have been saved as .ilayout files. What I need to do is to add and remove DockableFrame objects to/from the panel and load Visual Designer layouts accordingly.
For instance, if I push a button "A" a particular layout (ilayout file) with certain frames have to be loaded, if I push "B" a different layout and different frames need to be loaded...

Do you guys have any idea about it?
francesco78
 
Posts: 2
Joined: Tue Apr 10, 2007 6:57 am

Postby JIDE Support » Tue Oct 16, 2007 8:12 am

Initial layout tells where each dockable frame is and what the state is. It doesn't define a dockable frame. The docakble frame is still in your code and added to DockingManager. So if you want to have two different sets of dockable frames, you will need to make sure they are added/removed from DockingManager before loading the ilayout file.

So pseudo code will be something like this.

** Load A **
saveLayoutData("B"); // save the previous runtime layout
removeAllFrames(); // remove all the frames first so that we can add them later
addFrame;
addFrame; //add frames that belongs to A
loadInitialLayout("A.ilayout"); // load ilayout
loadLayoutData("A"); // load runtime layout

** Load B **
saveLayoutData("A"); // save the previous runtime layout
removeAllFrames(); // remove all the frames first so that we can add them later
addFrame;
addFrame; //add frames that belongs to B
loadInitialLayout("B.ilayout"); // load ilayout
loadLayoutData("B"); // load runtime layout


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Postby francesco78 » Mon Oct 22, 2007 3:59 am

I tried your solution, but it does not seem to work...
Actually, when I switch from a layout to another one, it seems that old dockable frames are still there and they do not disappear, even though I remove all of them...
Also, when you say saveLayoutData("B") do you mean saveLayoutDataAs("B") and when you say loadLayoutData("A") do you mean loadLayoutDataFrom("A")?
What sort of initialization should I make before getting into switching code?

Thanks a lot
francesco78
 
Posts: 2
Joined: Tue Apr 10, 2007 6:57 am

Postby JIDE Support » Mon Oct 22, 2007 11:23 am

When I said loadLayoutData("B"), I mean loadLayoutDataFrom("B"). "B" is just whatever profile name you want to use.

If you called removeAllFrames() and the new layout you are loading doesn't have the the frames you want to hide, there is no reason it shows up after loading that layout. In any case, if you can reproduce it in DockingFrameworkDemo, we can certainly take a look.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 5 guests