Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Docking Pane Caption with [X] button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Docking Pane Caption with [X] button

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Docking Pane Caption with [X] button
    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);
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2011 at 12:38pm
Or add some code to close them when I click on the tab?
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post 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.
Product: Codejock Xtreme SuitePro 15.3.1 for CommandBars
SuitePro 16.3.1 for all the rest

OS: Windows 8.1

Language: Visual Objects 2.8
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
cluster View Drop Down
Groupie
Groupie


Joined: 22 January 2015
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote cluster Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
cluster View Drop Down
Groupie
Groupie


Joined: 22 January 2015
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote cluster Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.