I have splitter window with 3 views as shown in fig below!
----------------
|
FrmView |FrmView
|
----------------
EditView
----------------
when i click to resize the mainframe at the bottom right,left or on top, the other 2 splitter view dissapers keeping only one main view which is associated with CDocTemplate! The code which i used to create Splitter window is as follows:
CEditUserInput: derived from CEditView.
CFormQuestion: derived from CFormView.
CFormOutput: derived from CFormView.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 2, 1))
return FALSE;
CRect rect;
GetWindowRect(rect);
if (!m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CEditUserInput), CSize(0,0), pContext))
{
return FALSE;
}
int nHt = rect.Height();
int nWd = rect. Width( );
m_wndSplitter.SetRowInfo(0, (nHt/2)+50,10);
m_wndSplitter.SetRowInfo(1, (nHt/2)-50,10);
if (!m_secondSplitter.CreateStatic(&m_wndSplitter,1,2,
WS_CHILD|WS_VISIBLE|WS_BORDER,
m_wndSplitter.IdFromRowCol(0,0)))
{
return false;
}
if (!m_secondSplitter.CreateView(0,0,RUNTIME_CLASS(CFormQuestion),
CSize(0,0), pContext ))
{
return false;
}
if (!m_secondSplitter.CreateView(0,1,RUNTIME_CLASS(CFormOutput),
CSize(0,0), pContext ))
{
return false;
}
m_secondSplitter.SetColumnInfo(0,nWd/2,10);
m_checkSplitterWnd = true;
return CFrameWndEx::OnCreateClient(lpcs, pContext);
}
DocTemplate Code:
// Register the application
// serve as the connection between documents, frame windows and views
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CPrajaktaDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CFormQuestion));