Does anyone know, how i can create 2 different views in one window (split window). One one side i need CScrollView and on the other side CHtmlView. I am also open for real MDI suggestions.
I just need the CScrollView side printed.
Add OnCreateClient to CMainFrame as shown below. Copy and past the code in the below OnCreateClient into yours. Add CSplitterWnd m_wndSplitter; to your class as private. Take RUNTIME_CLASS(CResultsView), and replace it with RUNTIME_CLASS(ScrollView). Take RUNTIME_CLASS(CACGView) and replace it with RUNTIME_CLASS(CHtmlView). Of course you'll need to add the header files up top for the new classes. Play with the CSize() to adjust the sizes to your liking.
Brother C
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
// create a splitter with 1 row, 2 columns
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n"
return FALSE;
}
// add the first splitter pane - the default view in column 0
if (!m_wndSplitter.CreateView(0, 0,
RUNTIME_CLASS(CResultsView),
CSize(150, 0), pContext))
{
TRACE0("Failed to create first pane\n"
return FALSE;
}
// add the second splitter pane - an input view in column 1
if (!m_wndSplitter.CreateView(0, 1,
RUNTIME_CLASS(CACGView),
CSize(0, 0), pContext))
{
TRACE0("Failed to create second pane\n"
return FALSE;
}
// activate the input view
SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
Now everything works; except one thing:
I cannot print the CScrollView side.
I've added a control handler to my derived CScrollView class, but it is not possible to call any standard handler on it. It works with the HTML side.
Can anyone tell me what to do?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.