Print Page | Close Window

Destroy pane on closing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4792
Printed Date: 15 November 2024 at 10:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Destroy pane on closing
Posted By: ABuenger
Subject: Destroy pane on closing
Date Posted: 14 August 2006 at 4:24am
I would like to destroy a pane if the user closes it. So far I had no success:
 
LRESULT CMainFrame::OnDockingPaneNotify (WPARAM wParam, LPARAM lParam)
{
   CXTPDockingPane *pPane = (CXTPDockingPane *) lParam;
 
   switch (wParam)
   {
   case XTP_DPN_CLOSEPANE:
      m_paneManager.DestroyPane (pPane);
      1) break;
      2) return XTP_ACTION_NOCLOSE;
   }
 
   return 0;
}
 
1) Causes a crash because the toolkit trys to close a destroyed pane after the event handler returns.
 
2) The pane is beeing destroyed and the toolkit doesn't try to close the pane anymore, but the pane isn't really destroyed. I've attached a view (AttachView) to the pane which isn't destroyed when calling DestroyPane. The view will be destroyed when the main frame is beeing closed.
 
In AttachView I can pass the parent window, but unfortunately I can not set the pane as the parent: cannot convert parameter 1 from 'class CXTPDockingPane *' to 'class CWnd *'
 
 


-------------
Codejock support



Replies:
Posted By: Oleg
Date Posted: 14 August 2006 at 7:48am
Hi,
You need XTP_ACTION_NOCLOSE + manually destroy child pane.
 
Something like:
 
if (pPane->GetChild()) pPane->GetChild()->DestroyWindow();
m_paneManager.DestroyPane (pPane);
return XTP_ACTION_NOCLOSE;


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


Posted By: ABuenger
Date Posted: 14 August 2006 at 8:27am
Thanks, pPane->GetChild()->DestroyWindow(); works. But the expected behaviour is if you destroy a window it's childs are destroyed too, which is not the case for the panes.


-------------
Codejock support


Posted By: Oleg
Date Posted: 14 August 2006 at 9:30am
Hi,
 
It is not expected behavior for panes.
For example if developer want to change layout he can destroy pane and create it again and it will not destory child. Or like in panes sample want to change from some "debug" to "Edit" layout.

-------------
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