Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » Tooltip on menu Collapse All
Subject Author Date
Jonathan Blank Nov 7, 2007 - 12:38 PM

I have a menu setup using TPMX_PALETTE mode.

pPopup->TrackFlagsSet(pPopup->TrackFlagsGet()    | TPMX_PALETTE);

Is it possible to make a tooltip appear when user mouse overs one of the menu item?

Thanks.

Suhai Gyorgy Nov 8, 2007 - 4:09 AM

With default settings, Prof-UIS popup menus do not display tooltips. If you want to change this, you should set the global CExtPopupMenuWnd::g_eTtsClassicMenu variable to a value other than CExtPopupMenuTipWnd::__ETS_NONE.
But since this variable is global, it will affect all popup menus in your application. I can only think of one solution to have the tooltips on the palette popup menus only and not on any other popup menu. But it feels like a little hacking.

There’s a message CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel, which is fired every time any popup menu appears. If you add a new entry in your mainframe message map like this:
ON_REGISTERED_MESSAGE(CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel, OnExtOneMenuLevelPrepare)
, then you can set the above mentioned global variable to the appropiate value, depending on the popup menu appearing:

LRESULT CMainFrame::OnExtOneMenuLevelPrepare(WPARAM wParam, LPARAM lParam)
{
	CExtPopupMenuWnd::MsgPrepareMenuData_t *pData = 
		reinterpret_cast<CExtPopupMenuWnd::MsgPrepareMenuData_t *>( wParam );
	ASSERT( pData != NULL );
	CExtPopupMenuWnd * pPopup = pData->m_pPopup;
	ASSERT( pPopup != NULL );
	if( (pPopup->TrackFlagsGet()&TPMX_PALETTE) == 0 )
		CExtPopupMenuWnd::g_eTtsClassicMenu = CExtPopupMenuTipWnd::__ETS_NONE;
	else
		CExtPopupMenuWnd::g_eTtsClassicMenu = CExtPopupMenuTipWnd::__ETS_RECTANGLE;
	return 0;
}

I haven’t tried the code though so there might be mistakes.