Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Disable popup submenu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Disable popup submenu

 Post Reply Post Reply
Author
Message
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Topic: Disable popup submenu
    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
Back to Top
antonin View Drop Down
Newbie
Newbie


Joined: 26 January 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote antonin Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2005 at 2:11pm
Use the command updateUI handler
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post 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:

 




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 May 2005 at 4:54am
you can assign some id in OnCreateControl handler.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
fishy View Drop Down
Newbie
Newbie
Avatar

Joined: 26 October 2005
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote fishy Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
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.187 seconds.