Print Page | Close Window

GetParent fails after move from Pane to CChildFram

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=5641
Printed Date: 12 December 2024 at 9:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetParent fails after move from Pane to CChildFram
Posted By: ContactGT
Subject: GetParent fails after move from Pane to CChildFram
Date 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?



Replies:
Posted By: Oleg
Date Posted: 30 November 2006 at 1:54am
Hi,
 
grab code from
 
Samples\ToolkitPro\MDITabWindow\MainFrm.cpp


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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