Closing a CXTPDockingPane |
Post Reply |
Author | |
ContactGT
Newbie Joined: 30 October 2006 Status: Offline Points: 28 |
Post Options
Thanks(0)
Posted: 14 November 2006 at 6:17am |
I have a CXTPDockingPane in my application and a menu item to turn the pane on and off - the menu item is ticked to indicate when the pane is visible. If I close the pane via my menu event handler, I do the following:
m_paneManager.DestroyPane(pane);
m_MTIClientWnd.Refresh(); In my menu OnUpdate method, I test the following to tick the menu item:
CXTPDockingPane *pane = m_paneManager.FindPane(IDGT_PANE_PROJBROWSER);
if ( (pane != NULL) && (!pane->IsHidden()) ) pCmdUI->SetCheck(true); else pCmdUI->SetCheck(false); The problem is when the user closes the pane using the 'x' in the corner - the pane is closed from the screen, but the FindPane method still finds the pane, so my code still shows a tick on the menu item . Do I need to add to my OnDockingPaneNotify, if (wParam == XTP_DPN_CLOSEPANE) method to destroy the pane properly? I have tried pPane->Detach(); but this doesn't do anything. I have tried m_paneManager.DestroyPane(pPane);, but this causes a crash.
Help!!
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
don't call DestroyPane if you need to show it later.
just check
if (pPane && pPane->IsClosed()) instead.
IsHidden check if pane in AutoHide Mode.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ContactGT
Newbie Joined: 30 October 2006 Status: Offline Points: 28 |
Post Options
Thanks(0)
|
I do want to destroy the pane and I don't want it later, but if I call DestroyPane inside the OnDockingPaneNotify method, it causes a crash. How can I DestroyPane when the user clicks the 'x' in the corner of a pane?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
If you want to destroy it, you can catch Action event and check if action is xtpPaneActionClosed.
|
|
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 |