|
-
June 17th, 2005, 03:15 AM
#1
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
-
June 17th, 2005, 07:58 AM
#2
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!
-
June 17th, 2005, 08:22 AM
#3
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.
-
June 17th, 2005, 08:29 AM
#4
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.
-
June 18th, 2005, 01:08 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|