About CXTSplitterWnd, how to switch? |
Post Reply |
Author | |
yangxm
Newbie Joined: 31 May 2009 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 31 May 2009 at 6:09am |
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{ // TODO: Add your specialized code here and/or call the base class if (!m_wndSplitter.CreateStatic(this, 1, 2)) { TRACE0("Failed to create splitter window\n"); return FALSE; } m_wndSplitter2.CreateStatic(&m_wndSplitter,3,1,WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(0, 1)); // m_wndSplitter3.CreateStatic(&m_wndSplitter,3,1,WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(0, 2)); if (!m_wndSplitter.CreateView(0,0, RUNTIME_CLASS(CView1),
CSize(100, 100), pContext)) { TRACE0("Failed to create CView1\n"); return FALSE; } if (!m_wndSplitter2.CreateView(0,0, RUNTIME_CLASS(CGraphView), CSize(00, 100), pContext)) { TRACE0("Failed to create CView2\n"); return FALSE; } if (!m_wndSplitter2.CreateView(1,0, RUNTIME_CLASS(CTrafficView), CSize(100, 100), pContext)) { TRACE0("Failed to create CView3\n"); return FALSE; } if (!m_wndSplitter2.CreateView(2,0, RUNTIME_CLASS(CInfoView), CSize(100, 100), pContext)) { TRACE0("Failed to create CView4\n"); return FALSE; } CRect r;
GetClientRect(&r); m_wndSplitter.SetRowInfo( 0, r.Height()/5, 0 ); return TRUE;
return CFrameWnd::OnCreateClient(lpcs, pContext); } void CMainFrame::OnSwapview()
{ CView* pView = (CView*)m_wndSplitter2.GetPane(2,0);
m_wndSplitter2.SwitchView(0, 0, pView); } 1 CView* pView = (CView*)m_wndSplitter2.GetPane(2,0);
2 m_wndSplitter.SwitchView(0, 0, pView); Switch throw out an Assert,why?
|
|
yangxm
Newbie Joined: 31 May 2009 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
help please!
|
|
yangxm
Newbie Joined: 31 May 2009 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
while
1 CView* pView = (CView*)m_wndSplitter.GetPane(2,0);
2 m_wndSplitter.SwitchView(0, 0, pView); no problem。 |
|
yangxm
Newbie Joined: 31 May 2009 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
it is seems to OK that in the same splitterwndbar |
|
yangxm
Newbie Joined: 31 May 2009 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
HOW TO Switch view between different splitterwnd |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |