| | | | Browse by category |
Problem
How do I place a record-info beam in the lower pane of a static splitter window?
Cause
Action
Do this in your MDIChildWnd's OnCreateClient():
BOOL CRecordStatusMDIChildWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { |
|||
m_pWndSplitter = new CSplitterWnd; m_pWndSplitter->CreateStatic(this, 2, 1); // Creates the TabWnd object |
|||
TRACE(Failed to create pane ); return FALSE; |
|||
}
if (!m_pWndSplitter->CreateView(1, 0, RUNTIME_CLASS(CGXRecordInfoWnd), CSize(0, (lpcs->cy / 2)), pContext)) |
|||
TRACE(Failed to create pane ); return FALSE; |
|||
}
m_pWndRecordInfo = (CGXRecordInfoWnd*) m_pWndSplitter->GetPane(1, 0); return m_pWndRecordInfo->Create(m_pWndSplitter, pContext, WS_CHILD|WS_HSCROLL|WS_VSCROLL); |
|||
} |
Note that you have to create a CGXRecordInfoWnd class for the lower pane. The CGXRecordInfoSplitterWnd class is itself a dynamic splitter window and does not cooperate well when embedded into another splitter window.