Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Combined Area Collapse All
Subject Author Date
Sebstian Leopold Nov 23, 2006 - 9:23 AM

I draw a custom button not derived from CWnd or CButton. It is just a drawn part of a window. By a click on this button a Popupmenu desiplays. Is there a Way to tell the popupmenü to use the button Rect as combined area ?

Technical Support Nov 23, 2006 - 12:28 PM

The lpRect parameter of the CExtPopupMenuWnd::TrackPopupMenu() method allows you to specify the combined area that can be combined with a parent item or be simply transparent depending on the currently installed paint manager. You can use a TPMX_COMBINE_NONE menu tracking flag to disable combining or the TPMX_COMBINE_ANY_SUITABLE flag to enable combining independently from the paint manager’s theme preferences. By default, the combined area is empty and only a themed background is painted onto it. If you want to draw some contents, you should specify the pCbPaintCombinedCookie and pCbPCC parameters when invoking the CExtPopupMenuWnd::TrackPopupMenu() method. The pCbPaintCombinedCookie value will be passed as a parameter into the pCbPCC callback function which should draw the contents in the combined part of menu. Please take a look at how the CExtPopupMenuWnd::TrackPopupMenu() method is invoked in the CExtBarButton::OnTrackPopup() method for tracking a popup menu from a toolbar button and how the CExtToolControlBar::_CbPaintCombinedContent() static callback function is implemented.