> I'm building an MDI app with two panes on a CSplitterWnd window. I think
> I want to use that splitter window to receive the messages from my
> toolbar which are currently being received by one of the panes
> (CTreeView derived, if that matters). I've run into a problem that Class
> Wizard, under "Class Info"\"Add New": CSplitterWnd isn't listed as a
> base class. I can subclass it myself but I want Class Wizard to do it
> (RAD and all, you know).
> First, is it a good idea to be using CSplitterWnd to handle messages for
> the panes?
> Second, is there a way to get ClassWiz to build it for me?
> TIA,
> Mike
I also use CSplitterWnd in my application.
If your application is a MFC derived application, in CMainFrame
you declare an intance of CSplitterWnd and then, on CMainFrame::OnCreateClient()
you create the two panes.
Here is a sample of my application:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpCreateStruct,
CCreateContext* pContext)
{
// create a splitter with 1 row, 2 columns
if (!wndSplitter.CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
// add the first splitter pane - the default view in column 0
if (!wndSplitter.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(Split, cy), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
// add the second splitter pane - an input view in column 1
if (!wndSplitter.CreateView(0, 1,
RUNTIME_CLASS(CMyListView), CSize(cx - Split, cy), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
// activate the input view
SetActiveView((CView*)wndSplitter.GetPane(0,1));
return TRUE;
Quote:}
My application was first based on Viewex (sample from Visual C++ 4.0 CD)
This sample will help you developing an App with CSplitterWnd.
Hope this helps.
Miguel.
--
---------------------------------------------------------------
---------------------------+ R Alves Redol n 9 - sala 338
Antonio Rodrigues | 1000 Lisboa Portugal
Daniel Amendoeira | Tel: +351 1 3100000 Ext: 2552
Miguel Algarvio | Fax: +351 1 3145843
---------------------------+-----------------------------------