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 generic programming Collapse All
Subject Author Date
Offer Har Aug 17, 2011 - 12:31 AM

Hi,


We see that the tooltip code is repeated in every control.


We would like to add some generic tooltip logic for all controls, but we cannot do it now because every class implements its own functions, for example, ActivateTooltip is written exactly the same for button, edit, combo-box and slider classes, the m_nAdvancedTipStyle member is repeated in 8 classes.


Can you please for future versions create some base class that will include all the tooltip related functions and members.


Thanks,


Ron.

Technical Support Aug 18, 2011 - 2:30 AM

This is not difficult. Most of the OnAdvancedPopupMenuTipWndGet() return pointer to the same CExtPopupMenuTipWnd object:

    return (&( CExtPopupMenuSite::g_DefPopupMenuSite.GetTip() ));

The CExtPopupMenuSite::g_DefPopupMenuSite static property is the global instance of the CExtPopupMenuSite class and it’s used as keeper for tooltip object and one root menu object (only one menu tree always displayed at any time). It also keeps one instance of ribbon screen tip. So, we have the following method for accessing the only one global tooltip object:
CExtPopupMenuTipWnd & CExtPopupMenuSite::GetTip()
{
    if( m_pWndToolTip == NULL )
        m_pWndToolTip = new CExtPopupMenuTipWnd;
    return (*m_pWndToolTip);
}

It’s initialized automatically. But we can add a new SetTip() method which will allow you to replace default tooltip object with your improved CExtPopupMenuTipWnd-derived object.\
Is that what you need?