Splitter window question...
-
Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying...
if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; }
Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door! -
Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying...
if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; }
Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door!Try this: Assuming that you want a view layout like this:
//////////////////////////////////////////
//+-----------+------------+
//| | |
//| | |
//| | |
//| | |
//| view 1 | view 2 |
//| | |
//| | |
//| | |
//| | |
//+-----------+------------+
//| view 3 |
//| |
//+------------------------+
//The trick is basically creating your splitter window within the other in order to get the right layout. The first splitter divides your window into two rows. Then using a second splitter, subdivide the upper row into two columns.. and viola
if(!m_wndSplitter.CreateStatic(this, 2, 1)) return FALSE; if(!m_wndSplitterB.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(0,0))) return FALSE; if (!m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CBottomView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; } if (!m_wndSplitterB.CreateView(0, 0, RUNTIME_CLASS(CLeftView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; } if (!m_wndSplitterB.CreateView(0, 1, RUNTIME_CLASS(CRightView),CSize(100, 100), pContext)) { TRACE0("Failed to create LeftView\n"); return FALSE; }
I Dream of Absolute Zero
-
Hello all, This should be easy but for some reason I am having troubles... I am trying to create a simple 3 view split in a SDI... I want the split to look like an upside down T, so a Left Top Pane, Right Top Pane, and a Bottom Pane (The bottom Pane needs to go from one side of the frame to the other). Here is what I am trying...
if(!m_wndSplitter.CreateStatic(this, 2, 2)) return FALSE; if(!m_BottomSplitter.CreateStatic(&m_wndSplitter, 1, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol(1,1))) return FALSE; if( !m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(175, 175), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } if(!m_BottomSplitter.CreateView(0, 0, RUNTIME_CLASS(CBottomView), CSize(100, 100), pContext)) { m_BottomSplitter.DestroyWindow(); return FALSE; }
Any ideas? Rob Whoever said nothing's impossible never tried slamming a revolving door!RobJones wrote:
Any ideas?
Yes. See the VIEWEX example on MSDN.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli