Print Page | Close Window

Popup menu not affected by command handlers?

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=8481
Printed Date: 31 October 2024 at 8:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Popup menu not affected by command handlers?
Posted By: znakeeye
Subject: Popup menu not affected by command handlers?
Date 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!




Replies:
Posted By: Oleg
Date Posted: 22 October 2007 at 2:22am
Hi,
 
Add TPM_NONOTIFY.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date 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?


Posted By: Oleg
Date 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


Posted By: znakeeye
Date 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);



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