Print Page | Close Window

Disable popup submenu

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=1879
Printed Date: 06 October 2024 at 3:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Disable popup submenu
Posted By: larryp
Subject: Disable popup submenu
Date Posted: 28 February 2005 at 11:07pm
How do I disable a popup submenu?  Since it does not have an ID, I don't know how to find it to call SetEnabled(false).  I would rather not use the caption since my program is translated into several languages.

Larry



Replies:
Posted By: antonin
Date Posted: 30 March 2005 at 2:11pm
Use the command updateUI handler


Posted By: larryp
Date Posted: 17 May 2005 at 2:46pm
UpdateUI handlers do not work in this case because the popup submenu does not have an id.

The case I am referring to is the Windows or Direct3D menu in the following example:

 






Posted By: Oleg
Date Posted: 18 May 2005 at 4:54am
you can assign some id in OnCreateControl handler.

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


Posted By: larryp
Date Posted: 20 May 2005 at 8:47am
Are there currently any samples that show assigning an id in the OnCreateControl handler?

Even in OnCreateControl, how do I know when to assign the id since it is called for all menu items?  I can narrow the choices by looking at the controlType (xtpControlPopup) but short of using the caption I dont' know when to assign the id.


Posted By: fishy
Date Posted: 27 October 2005 at 12:22pm
Did you ever figure this out?  I am wanting to do exactly the same thing and I can't find any samples that cover this situation at all.


Posted By: Oleg
Date Posted: 28 October 2005 at 6:17am

Hi,

Most easy way is to use WM_XTP_AFTERCREATECONTROL appeared in 9.80

ON_XTP_AFTERCREATECONTROL()

void CMainFrame::OnAfterCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
 if (lpCreateControl->pControl->GetCaption() == _T("&Window"))
 {
  lpCreateControl->pControl->SetID(1002);
 }

}



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



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