CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2011
    Posts
    60

    menuitem separator

    I'm using this tutorial for making an owner draw menu.

    http://www.codeguru.com/cpp/controls...ep-by-Step.htm

    When I go into the .rc file and remove all of the MENUITEM SEPARATORs all the menu options are squished to the left of the menu as in the screenshot. As long as there is just one MENU SEPARATOR anywhere the menu is fine. If I could make the application without MENU SEPARATORs that would be awesome. Any help would be great. Thanks for your time!!!
    Attached Images Attached Images  

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: menuitem separator

    Quote Originally Posted by Gregorina View Post
    I'm using this tutorial for making an owner draw menu.

    http://www.codeguru.com/cpp/controls...ep-by-Step.htm

    When I go into the .rc file and remove all of the MENUITEM SEPARATORs all the menu options are squished to the left of the menu
    May I ask why you "remove all of the MENUITEM SEPARATORs" from the .rc file?
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2011
    Posts
    60

    Re: menuitem separator

    With the OwnerDraw menu, separator's act as selections as seen in the screenshot. And in the application I'm working on the user won't be able to use a mouse, so one extra key press to select an option is annoying.Name:  ownerdraw2.jpg
Views: 301
Size:  8.2 KB

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: menuitem separator

    Quote Originally Posted by Gregorina View Post
    With the OwnerDraw menu, separator's act as selections as seen in the screenshot.
    I use the owner draw menu from http://www.codeproject.com/Articles/...itmaps-Version since more than a decade and never saw that menu separator could be "selected"!

    Somethimg seems to be wrong in your owner draw menu implementation!
    Victor Nijegorodov

  5. #5
    Join Date
    Mar 2011
    Posts
    60

    Re: menuitem separator

    Well if you are interested it does happen also in the demo project in the article I posted in the OP. Again, thanks for the help!!!

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: menuitem separator

    Quote Originally Posted by Gregorina View Post
    Well if you are interested it does happen also in the demo project in the article I posted in the OP.
    Yes, you are right.
    And the reason seems to be in the wrong handling (or just ignoring!)of the case of MF_SEPARATOR flag!
    See also this comment: http://www.codeproject.com/Articles/...819#xx828819xx
    Victor Nijegorodov

  7. #7
    Join Date
    Mar 2011
    Posts
    60

    Re: menuitem separator

    Quote Originally Posted by VictorN View Post
    Yes, you are right.
    And the reason seems to be in the wrong handling (or just ignoring!)of the case of MF_SEPARATOR flag!
    See also this comment: http://www.codeproject.com/Articles/...819#xx828819xx
    Awesome that helps. To check for a separator I'm just checking the string caption for a blank string(""), and that seems to we working fine. Just wondering if there is a better way to check for a separator flag?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: menuitem separator

    You could use CMenu::GetMenuState to check whether an item is a separator.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured