![]() |
Destroying a pane instead of closing |
Post Reply
|
| Author | |
Alex G.
Groupie
Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
Post Options
Thanks(0)
Quote Reply
Topic: Destroying a pane instead of closingPosted: 22 December 2004 at 2:23pm |
|
Hello,
how can I destroy the pane instead of closing it ? Of course I know about the method DestroyPane in class DockingPaneManager... Assume I want to destroy the pane after the user depressed the pane's close button. Thanks in advance ! Alex |
|
![]() |
|
spike
Groupie
Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 December 2004 at 9:12pm |
|
Well then you should call DestroyPane in the XTPN_CLOSE_PANE (sp?) notifcation in OnDockingPaneNotify.
|
|
![]() |
|
Alex G.
Groupie
Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 December 2004 at 5:31am |
I tried that of course too. But the pointer to the pane is still in use after the notification :
void CXTPDockingPaneManager::ClosePane(CXTPDockingPane* pPane) { if (pPane == NULL) return; if (m_pSite->SendMessage(XTPWM_DOCKINGPANE_NOTIFY, XTP_DPN_CLOSEPANE, (LPARAM)pPane) == XTP_ACTION_NOCLOSE) return; SAFE_CALLPTR(pPane->m_pPare ntContainer, RemovePane(pPane)); } |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 December 2004 at 7:46am |
|
you shold destroy it and return XTP_ACTION_NOCLOSE |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Alex G.
Groupie
Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 December 2004 at 2:08pm |
|
Thanks for your help !
It works fine this way : LRESULT FileBrowserFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam) { .. .. else if ( wParam == XTP_DPN_ACTION ) { XTP_DOCKINGPANE_ACTION *action = XTP_DOCKINGPANE_ACTION*)lParam; if ( action->action == xtpPaneActionClosed ) GetDockingPaneManager()- >DestroyPane( action->pPane ); return TRUE; } } |
|
![]() |
|
Alex G.
Groupie
Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 December 2004 at 2:23pm |
|
This is the optimized way
else if ( wParam == XTP_DPN_ACTION ) { XTP_DOCKINGPANE_ACTION *action = XTP_DOCKINGPANE_ACTION*)lParam; action->pPane->Detach(); pFileBrowserTreeView->DestroyWind ow(); pFileBrowserTreeView = NULL; if ( action->action == xtpPaneActionClosed ) GetDockingPaneManager()- >DestroyPane( action->pPane ); return TRUE; } |
|
![]() |
|
spike
Groupie
Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2005 at 2:34pm |
|
Thats kind of strange that you say the pointer is in use after the Close. This is my code which seems to work fine. FOREACH_ARRAY( m_arrOptionalPaneID, i ) if( pPane ) Edit: Actually they use SAFE_PTR call, which probly validates that the pointer. So it should be safe, nevertheless you have your solution.
Edited by spike |
|
![]() |
|
Alex G.
Groupie
Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2005 at 2:55am |
|
It's a matter of when you're destroying the pane. Try it if you're processing 'XTPN_CLOSE_PANE' notification - it will fail.
|
|
![]() |
|
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 |