CSplitterWnd

Hello,

I want to create application with splitters like that:

+---+--------+
| | 3 |
| 1 | |
+---+ |
| +--------|
| 2 | |
| | 4 |
+-----------+
| 5 |
+-----------+

1 is CArchitectureView
2 is CConfBNView
3 is CBNView
4 is CPropView
5 is CCROperationView

I use this code:

BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitterHorzInf.CreateStatic(this,2,1))
return FALSE;

if (!m_wndSplitterVert.CreateStatic(&m_wndSplitterHorzInf,1,2,WS_CHILD | WS_VISIBLE, m_wndSplitterHorzInf.IdFromRowCol(0, 0)))
return FALSE;

if (!m_wndSplitterHorzSupG.CreateStatic(&m_wndSplitterVert,2,1,WS_CHILD | WS_VISIBLE, m_wndSplitterVert.IdFromRowCol(0, 0)))
return FALSE;

if (!m_wndSplitterHorzSupD.CreateStatic(&m_wndSplitterVert,2,1,WS_CHILD | WS_VISIBLE, m_wndSplitterVert.IdFromRowCol(0, 0)))
return FALSE;

BOOL bFlag=m_wndSplitterHorzSupG.CreateView(0, 0, RUNTIME_CLASS(CArchitectureView), CSize(150,150),pContext);
bFlag &=m_wndSplitterHorzSupG.CreateView(1, 0, RUNTIME_CLASS(CConfBNView), CSize(150,150),pContext);
bFlag &=m_wndSplitterVert.CreateView(0, 1, RUNTIME_CLASS(CBNView), CSize(150,150), pContext);
bFlag &=m_wndSplitterHorzSupD.CreateView(1, 0, RUNTIME_CLASS(CPropView), CSize(150,150), pContext);
bFlag &=m_wndSplitterHorzInf.CreateView(1, 0, RUNTIME_CLASS(CCROperationView), CSize(150,150), pContext);

CRect rect;
GetWindowRect(rect);

m_wndSplitterVert.SetColumnInfo(0,rect.Width()/3,0);
m_wndSplitterHorzSupG.SetRowInfo(0,(rect.Height()/3),0);
m_wndSplitterHorzSupD.SetRowInfo(0,(rect.Height()/3),0);
m_wndSplitterHorzInf.SetRowInfo(0,(rect.Height()/3)*2,0);

return bFlag;
}

I can see 1,2,3 and 5 but not the splitter between 3 and 4.

Thanks for your help

Sanouk
[2225 byte] By [sanouk] at [2007-11-19 7:13:27]
# 1 Re: CSplitterWnd
m_wndSplitterHorzInf is between 5 and 2,4
m_wndSplitterVert is between 1,2 and 3,4
m_wndSplitterHorzSupG is between 1 and 2
m_wndSplitterHorzSupD is between 3 and 4
sanouk at 2007-11-11 0:28:09 >
# 2 Re: CSplitterWnd
It is very hard to read your requirements:
1. Use CODE when posting code. Copy and paste original code.
2. Instead trying character graphics draw mockup of your splitter and include it as graphic file.

After that you will get more response; most people do not want to spend time trying to decipher your post.
JohnCz at 2007-11-11 0:29:11 >
# 3 Re: CSplitterWnd
Here is what I think you want. In your code :

a) the "SupD" and "SupG" are using the same IdFromRowCol. You want to
use the second column for one of them.

b) I don't think you want to create a view on the "Vert"

c) I changed the code to use pContext->m_pNewViewClass instead of
RUNTIME_CLASS, since I don't have your classes

if (!m_wndSplitterHorzInf.CreateStatic(this,2,1))
return FALSE;

if (!m_wndSplitterVert.CreateStatic(&m_wndSplitterHorzInf,1,2,WS_CHILD | WS_VISIBLE, m_wndSplitterHorzInf.IdFromRowCol(0, 0)))
return FALSE;

if (!m_wndSplitterHorzSupG.CreateStatic(&m_wndSplitterVert,2,1,WS_CHILD | WS_VISIBLE, m_wndSplitterVert.IdFromRowCol(0, 0)))
return FALSE;

if (!m_wndSplitterHorzSupD.CreateStatic(&m_wndSplitterVert,2,1,WS_CHILD | WS_VISIBLE, m_wndSplitterVert.IdFromRowCol(0, 1))) // (0,0)
return FALSE;

BOOL bFlag=m_wndSplitterHorzSupG.CreateView(0, 0, pContext->m_pNewViewClass, CSize(150,150),pContext);
bFlag &=m_wndSplitterHorzSupG.CreateView(1, 0, pContext->m_pNewViewClass, CSize(150,150),pContext);
bFlag &=m_wndSplitterHorzSupD.CreateView(0, 0, pContext->m_pNewViewClass, CSize(150,150), pContext);
bFlag &=m_wndSplitterHorzSupD.CreateView(1, 0,pContext->m_pNewViewClass, CSize(150,150), pContext);
bFlag &=m_wndSplitterHorzInf.CreateView(1, 0, pContext->m_pNewViewClass, CSize(150,150), pContext);
Philip Nicoletti at 2007-11-11 0:30:12 >
# 4 Re: CSplitterWnd
Thanks

Sanouk
sanouk at 2007-11-11 0:31:18 >