Solved

Graying Popup Menu Items

Posted on 1997-11-03
7
360 Views
Last Modified: 2013-11-20
I have had success had graying out menu items in the OnUpdatMenuName(CCmdUI *pCmdUI) functions using

     pCmdUI->Enable(some BOOL);

how do I extend that to my pop up menus?  Thanks!
0
Comment
Question by:mitchell042997
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:wpinto
ID: 1309243
There's no difference between normal menus & pop up menus with respect to graying out menu items. Try out the same technique & it should work fine with pop up menus

Hope this helps

Wilfred
0
 
LVL 2

Expert Comment

by:wpinto
ID: 1309244
Hey mitchell,

You haven't accepted/rejected my previous answer to your question 'VC++ Menu question' under C++!

I would really appreciate if you could do the needful

Thanks,
Wilfred
0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1309245
I appologize.  I find your answer ineffective.  I have in my CDocument the mapped OnUpdatexxxUI already in place, yet it does not work for the popup menus.  Is there an additional function I need to use for popups?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Expert Comment

by:wpinto
ID: 1309246
Hi mitchell,

There is no additional function that you need to use apart from the OnUpdatexxx handler.

I have used it successfully.

Try out the following:
You said that you can enable/disable a menuitem. Choose any popup menu item & give it the same id as one of the menuitems which you can disable. Please note that the id should be the same. Now check to see if both the menuitems (ie. the original menuitem & the popup menuitem) are disabled.

If the original menuitem is disabled, the popup menuitem should also get disabled since they have the same ID.

Hope this helps

Wilfred

PS. You still haven't accepted/rejected my answer to the question 'VC++ Menu question' under C++. Its already over 2 weeks old. Since you have stated in this question that you can gray menuitems, I suppose that you are in a position to grade my previous answer.
0
 
LVL 2

Expert Comment

by:wpinto
ID: 1309247
Hi mitchell,

Did the above technique work?

Please let me know so that I can post it as an answer

Wilfred
0
 

Accepted Solution

by:
Vance Kessler earned 50 total points
ID: 1309248
I had similar problems.  I found that if I made the owning frame window be the target of the TrackPopupMenu() call, that the built in menu updating features of MFC did work properly.  Here is an example of how to call TrackPopupMenu to have this work:

void CMyWin::OnContextMenu(CWnd* pWnd, CPoint point)
{
   CMenu menu;
   if (!menu.LoadMenu(IDR_SOME_MENU) ) return;
   CMenu* mPtr = menu.GetSubMenu(0);
   if (NULL != mPtr) {
      mPtr->TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y,
            GetParentFrame() );
   }
}

0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1309249
Thanks for the info, Vance
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now