Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC
  New Posts New Posts RSS Feed - About CXTSplitterWnd, how to switch?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedAbout CXTSplitterWnd, how to switch?

 Post Reply Post Reply
Author
Message
yangxm View Drop Down
Newbie
Newbie


Joined: 31 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangxm Quote  Post ReplyReply Direct Link To This Post Topic: About CXTSplitterWnd, how to switch?
    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?
 
 
Back to Top
yangxm View Drop Down
Newbie
Newbie


Joined: 31 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangxm Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2009 at 11:51pm
help please!
Back to Top
yangxm View Drop Down
Newbie
Newbie


Joined: 31 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangxm Quote  Post ReplyReply Direct Link To This Post 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。
Back to Top
yangxm View Drop Down
Newbie
Newbie


Joined: 31 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangxm Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2009 at 5:55am

it is seems to OK that  in the same splitterwndbar

Back to Top
yangxm View Drop Down
Newbie
Newbie


Joined: 31 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangxm Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2009 at 5:57am

HOW TO Switch view between different splitterwnd

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.