[MFC] What am I doing wrong?? (SOLVED)

Started by
0 comments, last by D3DXVECTOR3 18 years, 9 months ago
Im seeing this:

-------------------------------------
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
-------------------------------------


but it should be like this:

-------------------------------------
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |--------------------------|
|        |                          |
|        |                          |
|        |                          |
|        |                          |
|        |                          |
-------------------------------------


Here is the source for the splitting. Im not getting any error messages/warnings the application fucntions perfectly.

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 create m_wndSplitter\n");
		return FALSE;
	}

	// add the second splitter pane - an input view in column 1
	if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CInfoPannel), CSize(200, 0), pContext))
	{
		TRACE0("Failed to create CInfoPannel pane\n");
		return FALSE;
	}


	// add the first splitter pane - the default view in column 0
	if (!m_wndSplitter.CreateView(0, 1, pContext->m_pNewViewClass, CSize(256, 50), pContext))
	{
		TRACE0("Failed to create ViewPort pane\n");
		return FALSE;
	}

	CRect cr;
	GetClientRect( &cr );

	if ( !m_mapSplitter.CreateStatic( &m_wndSplitter, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol( 0, 1 ) ) )
	{
		TRACE0("Failed to create m_mapSplitter\n");
		return FALSE;
	}

	// add the first splitter pane - the default view in column 0
	if (!m_mapSplitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(cr.Width(), cr.Height()/2), pContext))
	{
		TRACE0("Failed to create TileSet pane\n");
		return FALSE;
	}

	// add the first splitter pane - the default view in column 0
	if (!m_mapSplitter.CreateView(1, 0, pContext->m_pNewViewClass, CSize(cr.Width(), cr.Height()/2), pContext))
	{
		TRACE0("Failed to create ImageMap pane\n");
		return FALSE;
	}

	// activate the input view
	SetActiveView((CView*)m_wndSplitter.GetPane(0,1));

	return TRUE;
}


[Edited by - D3DXVECTOR3 on June 29, 2005 8:06:23 AM]
Advertisement
I got it :)

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 create m_wndSplitter\n");		return FALSE;	}	// add the second splitter pane - an input view in column 1	if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CInfoPannel), CSize(200, 0), pContext))	{		TRACE0("Failed to create CInfoPannel pane\n");		return FALSE;	}	CRect cr;	GetClientRect( &cr );	if (!m_wndSplitter2.CreateStatic( &m_wndSplitter, 2, 1, WS_CHILD | WS_VISIBLE | WS_BORDER, m_wndSplitter.IdFromRowCol( 0, 1 ) ) )	{		TRACE0("Failed to create m_mapSplitter\n");		return FALSE;	}	// add the first splitter pane - the default view in column 0	if (!m_wndSplitter2.CreateView(0, 0, pContext->m_pNewViewClass, CSize(cr.Width(), cr.Height()/2), pContext))	{		TRACE0("Failed to create TileSet pane\n");		return FALSE;	}	// add the first splitter pane - the default view in column 0	if (!m_wndSplitter2.CreateView(1, 0, pContext->m_pNewViewClass, CSize(cr.Width(), cr.Height()/2), pContext))	{		TRACE0("Failed to create ImageMap pane\n");		return FALSE;	}	return TRUE;}

This topic is closed to new replies.

Advertisement