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 » tootlip does not display for dynamic craeted menu itmes Collapse All
Subject Author Date
Offer Har Apr 26, 2008 - 10:37 AM

I have a menu items I creete at run time.


I setup my application to display tooltip for menu items:



    CExtPopupMenuWnd::g_eTtsClassicMenu = CExtPopupMenuTipWnd::__ETS_INV_RECTANGLE;
This works fine for menus from resource file. However, when I create the menu item at runtime in the CExtPopupBaseWnd::g_nMsgPrepareOneMenuLevel event handler, like this:

    pPopup->ItemInsertCommand(ID_COMMAND100, -1, "AAA\nBBB");


it does not display the tooltip (I was expecting to see BBB as a tooltip). I debugged it a little, and it seems that the tooltip is loaded using the command manager, which looks for the menu command string in the string table, which it obviously cannot find for my run-time created commands.


Can you please verify this problem and supply some kind of method to set tip to run-time created commands? If there is already a way to add tooltip to run-time commands, please explain how.


Thanks.


 

Technical Support Apr 28, 2008 - 10:42 AM

You should assign custom tooltips to your command items that inserted dynamically. Here are the methods that should be used: CExtPopupMenuWnd::MENUITEMDATA::GetCustomTip() and CExtPopupMenuWnd::MENUITEMDATA::SetCustomTip(). The CExtPopupMenuWnd::ItemGetInfo() method returns a reference to the CExtPopupMenuWnd::MENUITEMDATA object which describes the inserted menu item.