![]() |
Question about the right click on CXTPTabControl. |
Post Reply
|
| Author | |
Joanna
Newbie
Joined: 24 November 2006 Location: China Status: Offline Points: 10 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
akur
Senior Member
Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
Quote Reply
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' } } } |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |