Print Page | Close Window

Docking Pane Caption with [X] button

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=18794
Printed Date: 18 April 2024 at 8:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Docking Pane Caption with [X] button
Posted By: MacW
Subject: Docking Pane Caption with [X] button
Date Posted: 06 August 2011 at 9:44am
Hi,

is it possible to have a close button [x] on the caption of auto-hide panes?

Similar to CXTPTabCtrl's

ShowCloseItemButton(xtpTabNavigateButtonAutomatic);



Replies:
Posted By: MacW
Date Posted: 08 August 2011 at 12:38pm
Or add some code to close them when I click on the tab?


Posted By: Carlos Rocha
Date Posted: 08 August 2011 at 2:58pm
I get PaneActionFloating when clicking in a pane title bar (ActiveX version). I use it to maximize the pane, but maybe it works for what you want.

-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8


Posted By: MacW
Date Posted: 09 August 2011 at 1:52am
Thanks, Carlos

but this will not work in my case. When the user expands an auto-hide pane, my app gets the standard actions (expanding, expanded, activated...) Good.

But clicking on the tab (not the caption/title bar!) does not cause any event or action. My users want to be able to hide the pane by clicking on the tab.

When an auto-hide pane does not get the focus when the user opens it, it will automatically hide when the user moves the mouse out of the pane.

If the pane grabs the focus or the user sets the focus to the pane by clicking the pane itself or the child window, the pane will no longer auto-close when the mouse leaves the pane. The user has to explicitly set the focus to another window to make the pane close.

The mouse click is handled in

CXTPDockingPaneAutoHidePanel::OnLButtonDown

but there are no virtual functions or notifications to intercept or use. Adding the ability to hide the pane by clicking the tab would require source code changes in XTP.



Posted By: cluster
Date Posted: 21 November 2019 at 6:45pm
Hi,

I need this functionality also, do you already found a solution in the meantime?

THX

EDIT: Btw. Visual Studio 2013 has this feature as well


-------------
Windows 7
Visual Studio 2013
CodeJock 18.6


Posted By: cluster
Date Posted: 25 November 2019 at 6:20am
Ok I have found a solution which give me the Visual Studio 2013 behavior.

First step is, to disable the hover functionality with
SetDefaultPaneOptions( xtpPaneNoHoverShow );

Next step is to use a class derivation of CXTPDockingPaneAutoHidePanel and handle the OnLButtonDown function like:

void CDockingPaneAutoHidePanel::OnLButtonDown(UINT /*nFlags*/, CPoint point)
{
    if (m_pHighlightedNavigateButton)
    {
        m_pHighlightedNavigateButton->PerformClick(m_hWnd, point);
        return;
    }

    CXTPDockingPane* pPane = HitTest(point);
    if (pPane)
    {
        if (pPane->IsFocus())
        {
            pPane->Hide();
            SetFocus();
        }
        else
        {
            ShowPane(pPane, TRUE);
        }
    }
}




-------------
Windows 7
Visual Studio 2013
CodeJock 18.6



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