Popup menu not affected by command handlers? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 20 October 2007 at 6:00pm |
What am I doing wrong?
XTFuncContextMenu(pPopup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, pos.x, pos.y, this, NULL);
All items on the menu are enabled even though their IDs have been disabled on the mainframe menu! |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Add TPM_NONOTIFY.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Can't get it working. I've tried all different types of combinations.
TPM_NONOTIFY... altering pWndPopupOwner... using XTFuncContextMenu()... using CXTPCommandBars::TrackPopupMenu().
The menu items are always enabled, even if I add update handlers for them in my frame window!
What is the proper way of using the right-click menu?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ohh you need use handlers. ok.
when you can nonstatic version
pCommandBars->TrackPopupMenu.
Or better use ContextMenus internal feature - See CustomThems sample:
add in OnCreate:
pCommandBars->GetContextMenus()->Add(IDR_CONTEXT_MENU);
execute in handler:
((CXTPMDIFrameWnd*)AfxGetMainWnd())->GetCommandBars()->
TrackPopupMenu(IDR_CONTEXT_MENU, TPM_RIGHTBUTTON, point.x, point.y); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Thanks!
I found another solution too, which will also work when the menu is built in run-time...
XTFuncContextMenu(pPopup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, pos.x, pos.y, GetParentFrame(), NULL, 0);
|
|
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 |