CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: CMenu problem

  1. #1
    Join Date
    Sep 2001
    Location
    Rotmanka, Poland
    Posts
    88

    CMenu problem

    Hi !

    I making my class what is derive from CMenu.

    All items are add to menu with falg MF_OWNERDRAW.

    I see that if with MF_OWNERDRAW is use MF_POPUP MeasureItem is NOT call for this Item. Class use his values. I can draw this item, but not in my size and arrow (for show where will be draw next popup) are draw automaticly too.

    How support it ?

    Thnx in advance
    Olekba

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: CMenu problem

    Try handling ON_WM_MEASUREITEM() in your mainframe class. I've used owner draw menus and that's were I handle it.
    Gort...Klaatu, Barada Nikto!

  3. #3
    Join Date
    Sep 2001
    Location
    Rotmanka, Poland
    Posts
    88

    Re: CMenu problem

    Problem is, that for this items (POPUP) OnMeasureItem is NOT call too. This is work like without MF_OWNERDRAW, but this flag is add - I'm sure.

  4. #4
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: CMenu problem

    You can receive WM_MEAUREITEM messages for popup menus. When you add/insert the popup menu you specify the MF_OWNDRAWN flag.

    If its an existing menu then thou need to get he menu item MF_BYPOSITION hand set the MF_OWNDRAWN flag on the item.

    Popup menu arrow: Its not possible to render this yourself. Even in you know an item is a popup, windows automatically draws this arrow for you. The only way around is to cause windows to render to an offscreen bitmap and then overdraw its arrow. Its a right pain and really difficult to do, so I would not worry about it.
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  5. #5
    Join Date
    Sep 2001
    Location
    Rotmanka, Poland
    Posts
    88

    Re: CMenu problem

    Mike Harnad is right ! If I move it to mainframe all work super (hera was another one bug, so my preview post was wrong).

    All items (without separator ) have this same width now.

    THNX A LOT for all for help
    Olekba

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