Print Page | Close Window

About CXTSplitterWnd, how to switch?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Visual C++ MFC
Forum Description: Topics related to Codejock Visual C++ MFC products
URL: http://forum.codejock.com/forum_posts.asp?TID=14419
Printed Date: 23 November 2024 at 9:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: About CXTSplitterWnd, how to switch?
Posted By: yangxm
Subject: About CXTSplitterWnd, how to switch?
Date 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?
 
 



Replies:
Posted By: yangxm
Date Posted: 01 June 2009 at 11:51pm
help please!


Posted By: yangxm
Date Posted: 02 June 2009 at 5:53am
while
1    CView* pView = (CView*)m_wndSplitter.GetPane(2,0);
2    m_wndSplitter.SwitchView(0, 0, pView);
 
no problem。


Posted By: yangxm
Date Posted: 02 June 2009 at 5:55am

it is seems to OK that  in the same splitterwndbar



Posted By: yangxm
Date Posted: 02 June 2009 at 5:57am

HOW TO Switch view between different splitterwnd




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net