Print Page | Close Window

ShowPane undocked

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=5160
Printed Date: 12 December 2024 at 7:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ShowPane undocked
Posted By: TerryT
Subject: ShowPane undocked
Date Posted: 27 September 2006 at 11:54pm
I've not been able to find a solution to the following:
 
In the following method, how do I get the ShowPane() to show the pane in an undocked state (pin horizontal)?
 
void CMainFrame::togglePane(UINT nPaneID)
{
    CXTPDockingPane* pPane = m_paneManager.FindPane(nPaneID);
    if(pPane)
    {
        if(pPane->IsClosed())
            m_paneManager.ShowPane(pPane);
        else
            m_paneManager.ClosePane(pPane);
    }
}



Replies:
Posted By: akur
Date Posted: 28 September 2006 at 7:31am
Hello,

try a call to CXTPDockingPaneManager::ToggleDocking() immediately after showing the pane (if the pane is not IsFloating() already).
Or did you mean something else with undocking?


Posted By: TerryT
Date Posted: 28 September 2006 at 9:15am

Thanks for pointing me in the right direction - sometimes can't see the forest for the trees...

The following solution seems to work well enough
The code to empty the message queue is required to avoid an assert if there are no panes open - seems to happen when the docking frame is being adjusted


void CMainFrame::togglePane(UINT nPaneID)
{
    CXTPDockingPane* pPane = m_paneManager.FindPane(nPaneID);
    if(pPane)
    {
        if(pPane->IsClosed())
        {
            m_paneManager.ShowPane(pPane);
            m_paneManager.ToggleAutoHide(pPane);
            EmptyMsgQueue();
            pPane->Select();
        }
        else
            m_paneManager.ClosePane(pPane);
    }
}




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