Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Closing a CXTPDockingPane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Closing a CXTPDockingPane

 Post Reply Post Reply
Author
Message
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Topic: Closing a CXTPDockingPane
    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!!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 7:50am
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
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 11:41am
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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 1:43pm
Hello,
If you want to destroy it, you can catch Action event and check if action is xtpPaneActionClosed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.