Destroy pane on closing |
Post Reply |
Author | |
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
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 |