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 in dialogs!

Menu in dialogs!

Scheduled Pinned Locked Moved C / C++ / MFC
designtutorialquestion
4 Posts 2 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.
  • M Offline
    M Offline
    Manikandan
    wrote on last edited by
    #1

    Hi, How to make command UI fuctions like; pCmdUI->SetText, pCmdUI->Enable, pCmdUI->SetCheck to work when we have a menu in dialog? Currently it works for menus in SDI/MDI's but not in dialogs :confused:

    J 1 Reply Last reply
    0
    • M Manikandan

      Hi, How to make command UI fuctions like; pCmdUI->SetText, pCmdUI->Enable, pCmdUI->SetCheck to work when we have a menu in dialog? Currently it works for menus in SDI/MDI's but not in dialogs :confused:

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Manikandan wrote: How to make command UI fuctions like; pCmdUI->SetText, pCmdUI->Enable, pCmdUI->SetCheck to work when we have a menu in dialog? Currently it works for menus in SDI/MDI's but not in dialogs Check this post[^] -- jlr http://jlamas.blogspot.com/[^]

      M 1 Reply Last reply
      0
      • J Jose Lamas Rios

        Manikandan wrote: How to make command UI fuctions like; pCmdUI->SetText, pCmdUI->Enable, pCmdUI->SetCheck to work when we have a menu in dialog? Currently it works for menus in SDI/MDI's but not in dialogs Check this post[^] -- jlr http://jlamas.blogspot.com/[^]

        M Offline
        M Offline
        Manikandan
        wrote on last edited by
        #3

        Thanks Jose. I also found a easy way to do this something as below, // Get the popup menu which contains the "Lock" menu item. CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(2); submenu->CheckMenuItem(ID_LOCK, (m_bLock)?MF_CHECKED : MF_UNCHECKED | MF_BYCOMMAND); ;P

        J 1 Reply Last reply
        0
        • M Manikandan

          Thanks Jose. I also found a easy way to do this something as below, // Get the popup menu which contains the "Lock" menu item. CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(2); submenu->CheckMenuItem(ID_LOCK, (m_bLock)?MF_CHECKED : MF_UNCHECKED | MF_BYCOMMAND); ;P

          J Offline
          J Offline
          Jose Lamas Rios
          wrote on last edited by
          #4

          Well, that's a different approach. It means that whenever (and wherever) you change m_bLock, you have to get to the menu item and change it. The other approach goes the other way, whenever the menu needs to be shown (and only then), you get the chance to alter its state (enable, check, text, etc.). Besides, it's a general mechanism you can use for any menu item. But I agree that, if that's the only menu item you need to change and if m_bLock is only changed in a single place, your method is simpler :) -- jlr http://jlamas.blogspot.com/[^]

          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