Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Menu not enabled?

Menu not enabled?

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fredrik Skog
    wrote on last edited by
    #1

    Hi, I have got a problem with a popup menu that I have created in a CDialogBar. The menu item is grayed out when the menu is displayed.:( I use the same approach for some buttons, but there the menu item is enabled. Am I doing something wrong, or is there a way to enable the menu item? Cheers,
    /Fredrik

    Do you Sonork? I do! 100.11430:PhatBoy

    N 1 Reply Last reply
    0
    • F Fredrik Skog

      Hi, I have got a problem with a popup menu that I have created in a CDialogBar. The menu item is grayed out when the menu is displayed.:( I use the same approach for some buttons, but there the menu item is enabled. Am I doing something wrong, or is there a way to enable the menu item? Cheers,
      /Fredrik

      Do you Sonork? I do! 100.11430:PhatBoy

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      That could probably be because the menu-item handlers dont exist in the context. Like perhaps you have put them in a view, which is not valid when you show the popup menu, as the focus is on the control bar. Try putting the handlers in the frame window class Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

      F 1 Reply Last reply
      0
      • N Nish Nishant

        That could probably be because the menu-item handlers dont exist in the context. Like perhaps you have put them in a view, which is not valid when you show the popup menu, as the focus is on the control bar. Try putting the handlers in the frame window class Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

        F Offline
        F Offline
        Fredrik Skog
        wrote on last edited by
        #3

        It works if I put the handler in the frame window class, although I do not quite understand why.:confused: What I am trying to do, is to encapsulate the menu item handler in my derived toolbar class. I handle the WM_RBUTTONDOWN message in the toolbar class to display the menu. How do I do everything from the toolbar class? Cheers,
        /Fredrik

        Do you Sonork? I do! 100.11430:PhatBoy

        J 1 Reply Last reply
        0
        • F Fredrik Skog

          It works if I put the handler in the frame window class, although I do not quite understand why.:confused: What I am trying to do, is to encapsulate the menu item handler in my derived toolbar class. I handle the WM_RBUTTONDOWN message in the toolbar class to display the menu. How do I do everything from the toolbar class? Cheers,
          /Fredrik

          Do you Sonork? I do! 100.11430:PhatBoy

          J Offline
          J Offline
          James R Twine
          wrote on last edited by
          #4

          Fredrik Skoog wrote: It works if I put the handler in the frame window class, although I do not quite understand why    Because, by default, if you do not setup an ON_COMMAND* handler for a command, it will be disabled.  You also might want to look into how command routing works, so as to understand the order that is used when searching for a Command Handler.    Peace! -=- James.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups