Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - GetParent fails after move from Pane to CChildFram
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetParent fails after move from Pane to CChildFram

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


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Topic: GetParent fails after move from Pane to CChildFram
    Posted: 29 November 2006 at 12:00pm
I'm having trouble moving views between Docking panes and childframes. I have the following code that moves the active view between a Pane and a CChildFrame.
 
 
CView *activeView = (CView*) GetFocus();
 
 if (pane->IsClosed() && !pane->IsFloating())
 {
  // View is in childframe as pane is not visible (closed and not floating)
  pane->Attach(activeView);
  m_paneManager.ShowPane(pane);
 
  CChildFrame *activeChild = (CChildFrame*) GetActiveFrame();
  activeChild->SendMessage(WM_CLOSE);
 
  pane->SetFocus();
  *bInFrame = false;
 }
 else
 {
  // Pane is visible, so move to a child window
  CChildFrame *child = createCircaView(activeView->GetRuntimeClass());
 
  // Move the view onto the new childframe and move the new (unrequired) view
  // into the pane that is going to be destroyed.
  activeView->SetParent(child);
  child->SetActiveView(activeView);
 
  // Now activate and update the childframe
  m_MTIClientWnd.Refresh();
 
  // Close the relevant pane
  m_paneManager.ClosePane(pane);
  *bInFrame = true;
 }
 
This code seems to work in so much as it moves the view correctly between a pane and a CChildFrame, but the problem is later in my code, if the view is in a CChildFrame, then when I ask the view for ->GetParent(), I expect to get a pointer to a CChildFrame, but instead, I get a pointer to CXTPDockingPaneManager. If I ask for ->GetParentFrame(), I get the CMainFrame!. How do I get the CChildFrame parent of my View? Perhaps it is not getting set using the SetParent() call above?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2006 at 1:54am
Hi,
 
grab code from
 
Samples\ToolkitPro\MDITabWindow\MainFrm.cpp
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.125 seconds.