When a pane is not pinned, the IsHidden() method seems to be misbehaving. I have added a menu update handler to check or uncheck a menu item to let me know if a pane is hidden or not (forget close for now...that works).
In the menu update handler I check the pane->IsHidden and it always returns TRUE (pane is hidden) even when it's not. To reproduce, use the PaneSample project (samples\DockingPane\PaneSample).
I picked on PANE5 just to make this simple. Add a message map for the menu update in the cpp file as follows:
ON_UPDATE_COMMAND_UI(IDR_PANE5, OnUpdateUI_Pane5)
Add the prototype to the header file:
afx_msg void OnUpdateUI_Pane5(CCmdUI* pCmdUI);
Here's the handler for the cpp file:
void CMainFrame::OnUpdateUI_Pane5(CCmdUI* pCmdUI)
{
BOOL bChecked = TRUE;
CXTPDockingPane* pToolBeltPane = GetDockingPaneManager()->FindPane(IDR_PANE5);
if (pToolBeltPane)
{
TRACE("\n\nPane States\n");
BOOL bClosed = pToolBeltPane->IsClosed();
BOOL bFloating = pToolBeltPane->IsFloating();
BOOL bFocus = pToolBeltPane->IsFocus();
BOOL bHidden = pToolBeltPane->IsHidden();
BOOL bSelected = pToolBeltPane->IsSelected();
TRACE("Pane Closed: %d\n", bClosed);
TRACE("Pane Floating: %d\n", bFloating);
TRACE("Pane Focus: %d\n", bFocus);
TRACE("Pane Hidden: %d\n", bHidden);
TRACE("Pane Selected: %d\n", bSelected);
}
}
Run and watch the output window. Make pane5 un-pinned and visible (not hidden). Now go to the menus: Docking Pane / Pane
You'll see the results.
|