Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Popup menu not affected by command handlers?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Popup menu not affected by command handlers?

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Popup menu not affected by command handlers?
    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!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 October 2007 at 2:22am
Hi,
 
Add TPM_NONOTIFY.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2008 at 2:20pm
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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2008 at 3:47am
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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2008 at 11:45am
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);
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.125 seconds.