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. Ticks in menus

Ticks in menus

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • N Offline
    N Offline
    Nick Armstrong
    wrote on last edited by
    #1

    When I created my SDI aplication it gives you the choice of having a status bar, if you select yes to this, when your program is created it creates a View menu with a status bar option inside. When you click on this option, a tick appears next to this if the status bar is shown and disappears if not. I wish to copy this functionality with another menu item but cannot work out how it does this in my program, any ideas? Thanks in advance for any help, Nick

    R T 2 Replies Last reply
    0
    • N Nick Armstrong

      When I created my SDI aplication it gives you the choice of having a status bar, if you select yes to this, when your program is created it creates a View menu with a status bar option inside. When you click on this option, a tick appears next to this if the status bar is shown and disappears if not. I wish to copy this functionality with another menu item but cannot work out how it does this in my program, any ideas? Thanks in advance for any help, Nick

      R Offline
      R Offline
      Rashid Thadha
      wrote on last edited by
      #2

      On your OnUpdate handler use pCmdUI->SetCheck(m_bCondition);

      1 Reply Last reply
      0
      • N Nick Armstrong

        When I created my SDI aplication it gives you the choice of having a status bar, if you select yes to this, when your program is created it creates a View menu with a status bar option inside. When you click on this option, a tick appears next to this if the status bar is shown and disappears if not. I wish to copy this functionality with another menu item but cannot work out how it does this in my program, any ideas? Thanks in advance for any help, Nick

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        In ClassWizard, select the command ID. Then, from the list on the right side, select UPDATE_COMMAND_UI. Create the handler. Inside the handler, call pCmdUI->SetCheck with TRUE or FALSE. BTW: you should have a look on any MFC tutorial, like Scribble. Tomasz Sowinski -- http://www.shooltz.com

        N 1 Reply Last reply
        0
        • T Tomasz Sowinski

          In ClassWizard, select the command ID. Then, from the list on the right side, select UPDATE_COMMAND_UI. Create the handler. Inside the handler, call pCmdUI->SetCheck with TRUE or FALSE. BTW: you should have a look on any MFC tutorial, like Scribble. Tomasz Sowinski -- http://www.shooltz.com

          N Offline
          N Offline
          Nick Armstrong
          wrote on last edited by
          #4

          thanks, that worked and I have been able to open and close this dialog from the view menu with the tick being displayed/hidden but how do I get the tick in the menu to disappear when the dialog is closed using the close button on the top-right of the screen. I can handle it using OnClose() in the dialog's class but how do I link it to the menu. thanks for your help so far, Nick

          T 1 Reply Last reply
          0
          • N Nick Armstrong

            thanks, that worked and I have been able to open and close this dialog from the view menu with the tick being displayed/hidden but how do I get the tick in the menu to disappear when the dialog is closed using the close button on the top-right of the screen. I can handle it using OnClose() in the dialog's class but how do I link it to the menu. thanks for your help so far, Nick

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            ON_UPDATE_CMD_UI handler is called whenever user opens the menu. You have to check the state of the program and pass correct value to CCmdUI::SetCheck. Tomasz Sowinski -- http://www.shooltz.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