Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Question about the right click on CXTPTabControl.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Question about the right click on CXTPTabControl.

 Post Reply Post Reply
Author
Message
Joanna View Drop Down
Newbie
Newbie


Joined: 24 November 2006
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joanna Quote  Post ReplyReply Direct Link To This Post Topic: Question about the right click on CXTPTabControl.
    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 
 
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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'
        }
    }
}



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.