Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Resetting layout
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Resetting layout

 Post Reply Post Reply
Author
Message
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: Resetting layout
    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)
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 516
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 516
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.043 seconds.