Print Page | Close Window

Resetting layout

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1992
Printed Date: 07 November 2025 at 5:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Resetting layout
Posted By: dennisV
Subject: Resetting layout
Date Posted: 20 March 2005 at 6:36am

Hello,

I'm loading and saving the layouts for all my docking panes and MDI children, but is there a way to somehow "reset" them? I could delete them from the registry directly, but that wouldn't accomplish anything, because the current layout wouldn't be updated and when I exit the program, it would save whatever it was. Is there any better way I can solve this?

Thanks,



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



Replies:
Posted By: jimmy
Date Posted: 21 March 2005 at 4:31am
Hi,

After create all pane, i create a new Layout and save the current settings to this layout.
    m_pDefaultLayout = GetDockingPaneManager()->CreateLayout();
    GetDockingPaneManager()->GetLayout(m_pDefaultLayout);

and set it to default with

void CMainFrame::Panes_SetToDefaultLayout()
    {
    GetDockingPaneManager()->SetLayout(m_pDefaultLayout);
    }

    Jimmy



Posted By: dennisV
Date Posted: 21 March 2005 at 4:54am

Originally posted by jimmy jimmy wrote:

Hi,

After create all pane, i create a new Layout and save the current settings to this layout.
    m_pDefaultLayout = GetDockingPaneManager()->CreateLayout();
    GetDockingPaneManager()->GetLayout(m_pDefaultLayout);

and set it to default with

void CMainFrame::Panes_SetToDefaultLayout()
    {
    GetDockingPaneManager()->SetLayout(m_pDefaultLayout);
    }

    Jimmy

I think I understand, but then you'd want to do this only the first time the program is run, so you should keep track of that, correct? It does seem a bit of a waste of registry space, because I'd have to keep 2 versions of the layouts there - one which is the "fresh" one (which would be the same if the registry would just be cleared) and the current one.

At the moment, it's easier to just erase the relevant registry entries, but I want to see if there's a more elegant solution

Thanks!



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)


Posted By: jimmy
Date Posted: 21 March 2005 at 6:22am
Hi,

In there registry there is only saved one copy of layout settings.
I create the pane to a default setting. Save this to a member variable.
And then load the panesettings from registry to another member variable.
In the registry there is only saved the current pane layout. And not the default.

    Jimmy


Posted By: dennisV
Date Posted: 21 March 2005 at 6:27am

Originally posted by jimmy jimmy wrote:

Hi,

In there registry there is only saved one copy of layout settings.
I create the pane to a default setting. Save this to a member variable.
And then load the panesettings from registry to another member variable.
In the registry there is only saved the current pane layout. And not the default.

    Jimmy

Ah, ok I understand now!  Before doing a Load() of the layout from the registry, you store the default one as a local variable. Yes, that could work (going to go give it a try now) - thanks!



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)


Posted By: dennisV
Date Posted: 22 March 2005 at 4:17am

Hmm, there's still a problem - it now works fine in the sense that it does restore the layouts of the main MDIFrame and all MDIChildFrames (I have a separate pane manager in each child frame, so I save/load layouts for each of them), but it now screws up the insides of the docking panes that I have inside those child frames. Am I still missing something, or..., do you have docking panes in your frames?

 

Thanks.



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)


Posted By: Oleg
Date Posted: 22 March 2005 at 5:44am

Another option is to create member CreateLayout and move all calls there.

to reset just

m_paneManager.DestroyAll();

CreateLayout ();

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dennisV
Date Posted: 22 March 2005 at 5:49am
Originally posted by oleg oleg wrote:

Another option is to create member CreateLayout and move all calls there.

to reset just

m_paneManager.DestroyAll();

CreateLayout ();

 

And the CreateLayout() would contain the code that's normally there to create the docking panes and such?



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



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