Right Click Problem

This is a discussion on Right Click Problem within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I have set up a right click menu (it works), I am able to disable the menu items but ...

  1. #1
    fdy
    fdy is offline
    Registered User
    Join Date
    May 2004
    Posts
    9

    Right Click Problem

    Hi,
    I have set up a right click menu (it works), I am able to disable the menu items but they don't show greyed-out.
    The way I try to do this is by calling
    OnUpdateStart(CCmdUI *pCmdUI){
    pCmdUI->Enable(TRUE);
    }
    This works fine for normal menus, but not for the right click menu. But why won't they come out greyed-out?

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Are you referring to a context menu?

    Kuphryn

  3. #3
    fdy
    fdy is offline
    Registered User
    Join Date
    May 2004
    Posts
    9
    Thanks Kuphryn for your reply. Yeah it is a context menu-- when you press the right hand side button on the mouse it pops up. i have that much done, but when i call update event handlers to set enable false (disable it) for a particular item, it won't cause the item to appear grayed for some reason.

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    You usually set the status of context menu item before showing it.

    Kuphryn

  5. #5
    fdy
    fdy is offline
    Registered User
    Join Date
    May 2004
    Posts
    9
    Whether they are enabled or not depends on another variable (which changes).
    it works perfectly for a normal menu, but for some reason not for the right click context menu... thanks anyway

  6. #6
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    Have you added an ON_UPDATE_COMMAND_UI handler in your message map?

    How to Update User-Interface Objects

    gg

  7. #7
    fdy
    fdy is offline
    Registered User
    Join Date
    May 2004
    Posts
    9
    Yeah that is exactly what i have used and it does enable/disable the menu items but doesn't show them grayed/dimmed.
    i guess if noone else has had the same problem then i just must have done something silly somewhere.
    Thanks.

  8. #8
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    >> it does enable/disable the menu items but doesn't show them grayed/dimmed.
    So how are they shown?
    How do you know "it does enable/disable the menu items"?
    If you set a breatpoint in your handler, does CCmdUI::m_pMenu reference the correct menu?

    gg

  9. #9
    fdy
    fdy is offline
    Registered User
    Join Date
    May 2004
    Posts
    9
    They are just shown normally (text in black). if they are disabled they do nothing when they are clicked.
    yes i set the breakpoint in the handler and yes it is called correctly...
    it is a mystery!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  2. Problem with Mouse Over Menu!!! HELP!!!
    By SweeLeen in forum C++ Programming
    Replies: 3
    Last Post: 02-09-2006, 02:10 AM
  3. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  4. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 02:04 AM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21