Print Page | Close Window

Closing a CXTPDockingPane

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=5513
Printed Date: 12 December 2024 at 7:43am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Closing a CXTPDockingPane
Posted By: ContactGT
Subject: Closing a CXTPDockingPane
Date 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!!



Replies:
Posted By: Oleg
Date 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


Posted By: ContactGT
Date 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?


Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net