Little Splitter problem !
-
Hi, i coded a sdi project with 3 horizonta splitters, no problem. But now i want a vertical Splitter in the first pane,
********************
*------*-----------*
*------*-----------*
********************
*------------------*
*------------------*
*------------------*
********************
*------------------*
*------------------*
*------------------*
********************but this doesn't wotk :doh: :(( I don't get an error, but the chilsSplitter isn't shown ! Here is my code:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr;
GetClientRect(&cr);m\_Splitter\_Main.CreateStatic(this, 3, 1); m\_Splitter\_Main.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Main.CreateView(1, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Main.CreateView(2, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Child\_1.CreateStatic(&m\_Splitter\_Main, 1, 2, WS\_CHILD | WS\_VISIBLE, m\_Splitter\_Main.IdFromRowCol(0, 0)); m\_Splitter\_Child\_1.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(100, 0), pContext); m\_Splitter\_Child\_1.CreateView(0, 1, RUNTIME\_CLASS(CTest\_01View), CSize(0, 0), pContext); return TRUE;
}
Many, many thanx for your help ! Best regards Croc
-
Hi, i coded a sdi project with 3 horizonta splitters, no problem. But now i want a vertical Splitter in the first pane,
********************
*------*-----------*
*------*-----------*
********************
*------------------*
*------------------*
*------------------*
********************
*------------------*
*------------------*
*------------------*
********************but this doesn't wotk :doh: :(( I don't get an error, but the chilsSplitter isn't shown ! Here is my code:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr;
GetClientRect(&cr);m\_Splitter\_Main.CreateStatic(this, 3, 1); m\_Splitter\_Main.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Main.CreateView(1, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Main.CreateView(2, 0, RUNTIME\_CLASS(CTest\_01View), CSize(cr.Width(), cr.Height()/3), pContext); m\_Splitter\_Child\_1.CreateStatic(&m\_Splitter\_Main, 1, 2, WS\_CHILD | WS\_VISIBLE, m\_Splitter\_Main.IdFromRowCol(0, 0)); m\_Splitter\_Child\_1.CreateView(0, 0, RUNTIME\_CLASS(CTest\_01View), CSize(100, 0), pContext); m\_Splitter\_Child\_1.CreateView(0, 1, RUNTIME\_CLASS(CTest\_01View), CSize(0, 0), pContext); return TRUE;
}
Many, many thanx for your help ! Best regards Croc
You might also need:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
if(::IsWindow(m_Splitter_Main.m_hWnd) && ::IsWindow(m_Splitter_Child_1.m_hWnd))
{
m_Splitter_Main.SetRowInfo(0, cy/3, 10);
m_Splitter_Main.SetRowInfo(1, cy/3, 10);
m_Splitter_Main.SetRowInfo(2, cy/3, 10);m\_Splitter\_Child\_1.SetColumnInfo(0, cx/2, 10); m\_Splitter\_Child\_1.SetColumnInfo(1, cx/2, 10); RecalcLayout(); }
}
You could probably call
SetRowInfo()
andSetColumnInfo()
at the end ofOnCreateClient()
, but I did not try."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
You might also need:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
if(::IsWindow(m_Splitter_Main.m_hWnd) && ::IsWindow(m_Splitter_Child_1.m_hWnd))
{
m_Splitter_Main.SetRowInfo(0, cy/3, 10);
m_Splitter_Main.SetRowInfo(1, cy/3, 10);
m_Splitter_Main.SetRowInfo(2, cy/3, 10);m\_Splitter\_Child\_1.SetColumnInfo(0, cx/2, 10); m\_Splitter\_Child\_1.SetColumnInfo(1, cx/2, 10); RecalcLayout(); }
}
You could probably call
SetRowInfo()
andSetColumnInfo()
at the end ofOnCreateClient()
, but I did not try."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
Thx very much ! :-D Now it works ! Best regards Croc ! :-D :-D :-D :-D