![]() |
Resetting layout |
Post Reply
|
| Author | |
dennisV
Senior Member
Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
Quote Reply
Topic: Resetting layoutPosted: 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) |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
dennisV
Senior Member
Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 March 2005 at 4:54am |
|
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) |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
dennisV
Senior Member
Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 March 2005 at 6:27am |
|
Ah, ok I understand now! |
|
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
|
dennisV
Senior Member
Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
Quote Reply
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) |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
dennisV
Senior Member
Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2005 at 5:49am |
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) |
|
![]() |
|
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 |