I have attached a picture of what I'm getting when the window is created (http://imagebin.org/41999) as well as the picture of what I want the window to initialize the views (http://imagebin.org/42000). However, I have had some trouble acquiring the appropriate client rectangle to size it properly. Below is my OnCreateClient function that is responsible for creating the splitter views. It would be great to hear what I'm doing inappropriately with the sizing. Thanks in advance.
Code:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
AllocConsole(); // console for debugging
freopen("CONOUT$", "wb", stdout);
if(!m_subwndSplitter.CreateStatic(this, 2, 1))
return FALSE;
CRect rect;
GetClientRect(&rect);
if(!m_subwndSplitter.CreateView(1, 0, RUNTIME_CLASS(NeedleInsertControl), CSize(rect.Width(), 50), pContext))
return FALSE;
if (!m_wndSplitter.CreateStatic(&m_subwndSplitter, 1, 2, WS_CHILD | WS_VISIBLE | WS_BORDER, m_subwndSplitter.IdFromRowCol(0,0)))
{
AfxMessageBox(_T("Splitter window cannot be created"));
return FALSE;
}
// first pane
if(!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CsplitterView), CSize(rect.Width()/5,rect.Height()-50), pContext))
{
AfxMessageBox( "Error setting up splitter frames!");
return FALSE;
}
//Second pane
if(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(dummyview), CSize(rect.Width()-rect.Width()/5,rect.Height()-50), pContext))
{
AfxMessageBox( "Error setting up splitter frames!");
return FALSE;
}
return TRUE;
}