Add two CSplitterWnd type variables into the MainFrame:
CSplitterWnd m_wndSplitterLM; // split the window to left and middle panel
// Than add the following code into the OnCreateClient Function:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
// create a splitter with 1 row, 2 columns
if (!m_wndSplitterLM.CreateStatic(this, 1, 2))
{
TRACE("SpltLR create failed\n");
return false;
}
// add the first splitter pane - the default view in column 0
if (!m_wndSplitterLM.CreateView(0, 0,
RUNTIME_CLASS(CMultiLayerTree), CSize(60, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
// add the second splitter pane - which splits the right window into two columns
if (!m_wndSplitterMR.CreateStatic(
&m_wndSplitterLM, // our parent window is the first splitter
1, 2, // the new splitter is 1 rows, 2 column
WS_CHILD | WS_VISIBLE, // style, WS_BORDER is needed
m_wndSplitterLM.IdFromRowCol(0, 1)
// new splitter is in the first row, 2nd column of first splitter
))
{
TRACE0("Failed to create nested splitter\n");
return FALSE;
}
if (!m_wndSplitterMR.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(600, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
if (!m_wndSplitterMR.CreateView(0, 1,
RUNTIME_CLASS(CCtrlPanel), CSize(40, 0), pContext))
{
TRACE0("Failed to create third pane\n");
return FALSE;
}
return true;
}
CSplitterWnd m_wndSplitterLM; // split the window to left and middle panel
// Than add the following code into the OnCreateClient Function:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
// create a splitter with 1 row, 2 columns
if (!m_wndSplitterLM.CreateStatic(this, 1, 2))
{
TRACE("SpltLR create failed\n");
return false;
}
// add the first splitter pane - the default view in column 0
if (!m_wndSplitterLM.CreateView(0, 0,
RUNTIME_CLASS(CMultiLayerTree), CSize(60, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
// add the second splitter pane - which splits the right window into two columns
if (!m_wndSplitterMR.CreateStatic(
&m_wndSplitterLM, // our parent window is the first splitter
1, 2, // the new splitter is 1 rows, 2 column
WS_CHILD | WS_VISIBLE, // style, WS_BORDER is needed
m_wndSplitterLM.IdFromRowCol(0, 1)
// new splitter is in the first row, 2nd column of first splitter
))
{
TRACE0("Failed to create nested splitter\n");
return FALSE;
}
if (!m_wndSplitterMR.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(600, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
if (!m_wndSplitterMR.CreateView(0, 1,
RUNTIME_CLASS(CCtrlPanel), CSize(40, 0), pContext))
{
TRACE0("Failed to create third pane\n");
return FALSE;
}
return true;
}
Comments