ericcnc
asked on
Geting a MDI splitter window to create a tab control
BOOL CChildFrame::OnCreateClien t(LPCREATE STRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
// All this **** is to find the pointer to latest CCNCNestDoc
CMultiDocTemplate *pDocTemplate = THE_APP->m_pCNCNestDocTemp late;
ASSERT(pDocTemplate);
POSITION Pos = pDocTemplate->GetFirstDocP osition();
CCNCNestDoc *pDoc;
while(pDoc = (CCNCNestDoc*)pDocTemplate ->GetNextD oc(Pos))
{
if(Pos == NULL) // Final document is reached
break;
}
ASSERT(pDoc);
m_pDoc = pDoc;
I created a 3 way splitter window with the code below
CRect arect;
GetClientRect(&arect);
CSize size=arect.Size();
size.cx/=4;
size.cy/=4;
// Create the splitter window with two rows
if (!m_wndSplitter.CreateStat ic(this, 1, 2))
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
// Left splitter window
if (!m_wndSplitter.CreateView (0,0,RUNTI ME_CLASS(C CNCNestVie w),//
size, pContext))
{
m_wndSplitter.DestroyWindo w();
return -1;
}
if (!m_wndSplitter2.CreateSta tic(&m_wnd Splitter, 2, 1,
WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0,1)))
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
//Top right
if (!m_wndSplitter2.CreateVie w(0,0,RUNT IME_CLASS( CCNCNestVi ew),
CSize(0, 450), pContext))
{
m_wndSplitter.DestroyWindo w();
return -1;
}
// Bottom right
if (!m_wndSplitter2.CreateVie w(1,0,RUNT IME_CLASS( CJobSettin gsView),// CJobSettin gsView CNestListView
CSize(0, 0), pContext))
{
m_wndSplitter.DestroyWindo w();
return -1;
}
// Set pointers to the two splitter pane frame windows
m_pTreeFrame = (CFrameWnd*)m_wndSplitter. GetPane(0, 0);
ASSERT(m_pDrawingFrame);
m_pDrawingFrame= (CFrameWnd*)m_wndSplitter2 .GetPane(0 ,0);
ASSERT(m_pDetailsFrame);
m_pDetailsFrame = (CFrameWnd*)m_wndSplitter2 .GetPane(1 ,0);
ASSERT(m_pDetailsFrame);
//more then one windown
GetParentFrame()->RecalcLa yout();
GetParentFrame()->RecalcLa yout();
return TRUE;
// Commented out else splitter is not created
// return CMDIChildWnd::OnCreateClie nt(lpcs, pContext);
}
Now I want to create a tab control window in the far left pane (similar to VC++ workspace the tabs will take up the whole pane!!!) that has a tree control on both tabs. I've been pounding my head and trying to figure this out for a couple of days and I've got nothing. I have plenty of points that is not a problem, and if I get spoon feed what to do that is fine by me.
corrently I have a formview in bottom right pane and Now I need to get the right pane working.
{
// TODO: Add your specialized code here and/or call the base class
// All this **** is to find the pointer to latest CCNCNestDoc
CMultiDocTemplate *pDocTemplate = THE_APP->m_pCNCNestDocTemp
ASSERT(pDocTemplate);
POSITION Pos = pDocTemplate->GetFirstDocP
CCNCNestDoc *pDoc;
while(pDoc = (CCNCNestDoc*)pDocTemplate
{
if(Pos == NULL) // Final document is reached
break;
}
ASSERT(pDoc);
m_pDoc = pDoc;
I created a 3 way splitter window with the code below
CRect arect;
GetClientRect(&arect);
CSize size=arect.Size();
size.cx/=4;
size.cy/=4;
// Create the splitter window with two rows
if (!m_wndSplitter.CreateStat
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
// Left splitter window
if (!m_wndSplitter.CreateView
size, pContext))
{
m_wndSplitter.DestroyWindo
return -1;
}
if (!m_wndSplitter2.CreateSta
WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
//Top right
if (!m_wndSplitter2.CreateVie
CSize(0, 450), pContext))
{
m_wndSplitter.DestroyWindo
return -1;
}
// Bottom right
if (!m_wndSplitter2.CreateVie
CSize(0, 0), pContext))
{
m_wndSplitter.DestroyWindo
return -1;
}
// Set pointers to the two splitter pane frame windows
m_pTreeFrame = (CFrameWnd*)m_wndSplitter.
ASSERT(m_pDrawingFrame);
m_pDrawingFrame= (CFrameWnd*)m_wndSplitter2
ASSERT(m_pDetailsFrame);
m_pDetailsFrame = (CFrameWnd*)m_wndSplitter2
ASSERT(m_pDetailsFrame);
//more then one windown
GetParentFrame()->RecalcLa
GetParentFrame()->RecalcLa
return TRUE;
// Commented out else splitter is not created
// return CMDIChildWnd::OnCreateClie
}
Now I want to create a tab control window in the far left pane (similar to VC++ workspace the tabs will take up the whole pane!!!) that has a tree control on both tabs. I've been pounding my head and trying to figure this out for a couple of days and I've got nothing. I have plenty of points that is not a problem, and if I get spoon feed what to do that is fine by me.
corrently I have a formview in bottom right pane and Now I need to get the right pane working.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
tried my comment ?
Roshmon
Roshmon
ASKER
I downloaded the library, and I will look at it tomorrow to see If I can get it to work.
ASKER
I have been playing with the library and that is not working. I just cannot get a window to create or work, I cannot get a view to work...obvously it is me. BUT, I will keep playing and trying until I get something to work
ASKER
P.S. If any body out there has made a tree control with tabs in the first pane of a 3-way splitter by al means I could use your brain.......!!!!!!!
ASKER
there has to be a way to do this very easily.........