Print Page | Close Window

Question about the right click on CXTPTabControl.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6796
Printed Date: 12 November 2025 at 1:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Question about the right click on CXTPTabControl.
Posted By: Joanna
Subject: Question about the right click on CXTPTabControl.
Date Posted: 04 April 2007 at 5:23am
Hi,
 
I intent to get the notify when the user right click on the CXTPTabControl, but when I use following code to define this notify, it cannot work. When the user right click onthe CXTPTabControl, the code cannot run into the fucntion of "OnTabContrlRClick"?
 
Does the OnTabContrlRClick cannot response to the "NW_RCLICK" notification? But it can respond to the "TCN_SELCHANGE".
Then how can I get the notify of the right click on the CXTPTabControl?
 
 
ON_NOTIFY(TCN_SELCHANGE, IDC_TABCONTROL, OnSelectedChanged)
 
ON_NOTIFY(NM_RCLICK, IDC_TABCONTROL, OnTabContrlRClick)
 
PS:
Using Xtreme ToolkitPro 2006 v10.1.1.0 in VS2005.
 
And the structure of my program is like this:
The CMainFrame is deviced from CXTPMDIFrameWnd, so the document are tabbed in the top.
But in each view, there are aslo tabbed views in the buttom of each view, so in the CMyView, there is an member variable as following:
CXTPTabControl m_wndTabControl;
 
Here, I intent to get the notify of the right click on the "CXTPTabControl", but I failed, so looking for your help.
 
Thanks!
Joanna 
 



Replies:
Posted By: akur
Date Posted: 04 April 2007 at 6:49am
Hello,

perhaps this will solve your problem - even if indirectly. You can catch contextmenu requests in your CMyView (the parent window of your m_wndTabControl). You can use a code like this:

void CMyView::OnContextMenu(CWnd* pWnd, CPoint point)
{
    if (point == CPoint(-1, -1)) // ignore contextmenu from keyboard
        return;

    if (dynamic_cast<CXTPTabControl*> (pWnd))
    {
        m_wndTabControl.ScreenToClient(&point);
        CXTPTabManagerItem* pRightClickedItem = m_wndTabControl.HitTest(point);
        if (pRightClickedItem)
        {
            // ... use 'pRightClickedItem'
        }
    }
}






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