Sign in to follow this  
D3DXVECTOR3

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

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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;
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this