![]() |
Destroying a pane instead of closing |
Post Reply ![]() |
Author | |
Alex G. ![]() Groupie ![]() Joined: 22 December 2004 Location: Germany Status: Offline Points: 74 |
![]() ![]() ![]() ![]() ![]() Posted: 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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
![]() 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 ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |