GetParent fails after move from Pane to CChildFram |
Post Reply |
Author | |
ContactGT
Newbie Joined: 30 October 2006 Status: Offline Points: 28 |
Post Options
Thanks(0)
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?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
grab code from
Samples\ToolkitPro\MDITabWindow\MainFrm.cpp
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |