Print Page | Close Window

How to use "EnableContextMenus()"

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6827
Printed Date: 03 March 2025 at 5:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use "EnableContextMenus()"
Posted By: KumarCJ
Subject: How to use "EnableContextMenus()"
Date Posted: 10 April 2007 at 7:58am
Hi,
 
We are upgrading our application from code jock 4.2 to code jock 10.4.2.
 
For disabling, Context Menus, we were using following code in code jock 4.2 version of our application.
 
//m_wndMenuBar.EnableContextMenus(FALSE);
//m_wndToolBar.EnableContextMenus(FALSE);
 
I had added the following code for Code jock 10.4.2.
 
CXTPMenuBar* pMenuBar;
CXTPToolBar* pToolBar;
.
.
.
.
//pMenuBar->EnableContextMenus(FALSE);
//pToolBar->EnableContextMenus(FALSE);
 
 
How we can use "EnableContextMenus()" to enable/disable the Context Menus in code jock 10.4.2.
 
Please Help me out regarding this issue.
 
Thanks,
KumarCJ



Replies:
Posted By: Oleg
Date Posted: 10 April 2007 at 2:53pm
Hi,
One of solution is catch WM_XTP_TOOLBARCONTEXTMENU and remove all controls from  pPopup - LPARAM.
 
CXTPPopupBar* pPopup = (CXTPPopupBar*)lParam;
 


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


Posted By: KumarCJ
Date Posted: 11 April 2007 at 3:15am
Hi Oleg,
 
Thanks alot.
 
I catched "WM_XTP_TOOLBARCONTEXTMENU" and in the handler remove all controls from  pPopup - LPARAM, using follwing code:
 
CXTPPopupBar* pPopup = (CXTPPopupBar*)lParam;
pPopup->GetControls()->RemoveAll();
 
Is the avobe code is the replacement for given below code for both Menu and ToolBar EnableContextMenu
 
//pMenuBar->EnableContextMenus(FALSE);  //Menu
//pToolBar->EnableContextMenus(FALSE);   //ToolBar
 
Or else for ToolBar some other code is required?
 
Please Confirm on this.
 
Waiting for your reply.
 
Thanks in Advance.
KumarCJ.


Posted By: Oleg
Date Posted: 11 April 2007 at 3:52am
Hi,
 
yes, it will disable context menu for all toolbars and menus.


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


Posted By: KumarCJ
Date Posted: 11 April 2007 at 4:57am
Thanks alot Oleg for support.



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