-
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
-
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.
-
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.
-
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.
-
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