I have worked through the "Add a Docking Pane to your application" tutorial and everything is working perfectly, except for the restore of Pane positions...
In my MainFrame class I have lines of code like this (for each pane) of these in my header file:
CXTPDockingPane *pwndProjList; ProjectListTabCtrl m_wndProjectListWindow;
And in my OnCreate() method (above the code to restore the layout) I have a number of lines of code like this (for each pane):
pwndProjList = m_paneManager.CreatePane(IDR_PANE_PROJLIST, CRect(0, 0,200, 250), xtpPaneDockBottom); m_wndProjectListWindow.Create(TCS_TABS | TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE, CRect(0,0,0,0), this, IDGT_PROJ_LIST_WND); pwndProjList->Attach(&m_wndProjectListWindow);
This creates a pane containing a list control.
I have added the following code to my OnCreate() method after the above code:
// Load the previous state for docking panes. CXTPDockingPaneLayout layoutNormal(&m_paneManager); if (layoutNormal.Load(_T("NormalLayout"))) { m_paneManager.SetLayout(&layoutNormal); }
And in my OnClose method I have added the following code:
// Save the current state for docking panes. CXTPDockingPaneLayout layoutNormal(&m_paneManager); m_paneManager.GetLayout(&layoutNormal); layoutNormal.Save(_T("NormalLayout"));
If I include the layoutNormal code above, then the panes move to exactly where I left them, but their contents all disappear (all panes just go grey). If I remove the layoutNormal code, then the panes have content, but appear in the default positions (obviously). Am I going about restoring the pane positions in the wrong way? How do I get my content to display back?
|