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 » Show tooltip until mouse moved Collapse All
Subject Author Date
Offer Har Aug 14, 2011 - 12:22 AM

Dear Support,


I have a case in which I want to show a tooltip when a control loses focus.


I implemented it in the OnKillFocus by adding this code:



        CExtPopupMenuTipWnd& tooltip = CExtPopupMenuSite::g_DefPopupMenuSite.GetTip();
        CRect rcArea;
        GetWindowRect(&rcArea);
        tooltip.SetText( LPCTSTR("HELLO") );
        tooltip.SetTipStyle(CExtPopupMenuTipWnd::__ETS_BALLOON);
        tooltip.Show((CWnd*)this, rcArea, true);

This works fine, however, when the mouse is not over the control, and the user presses the tab button, the tooltip is displayed for a very short time, as the control is not over control.


Is there any way to tell CExtPopupMenuTipWnd to hide itself after a longer time, or only when the mouse moves?


Thanks,


Ron.

Technical Support Aug 15, 2011 - 7:31 AM

The CExtPopupMenuTipWnd runs the ID_TIMER_DELAY_KILL until it’s displayed. This timer detects mouse position changing. If the mouse is outside the rectangle specified in parameter of CExtPopupMenuTipWnd::Show() method, the timer handler hides the tooltip window. The CExtPopupMenuTipWnd::m_bNoHideDetection turns off the ID_TIMER_DELAY_KILL timer handler.

Offer Har Aug 17, 2011 - 12:35 AM

That’s exactly what I was looking for.

Technical Support Aug 15, 2011 - 7:29 AM

Create and use your own CExtPopupMenuTipWnd-derived class. Handle the WM_TIMER message. If the ID_TIMER_DELAY_KILL (671) timer event is received, do not invoke the parent class method and start your own timer which will continue the life of tooltip window and make it visible longer time.

Technical Support Aug 14, 2011 - 9:17 AM

The CExtPopupMenuTipWnd window hides itself automatically. It monitors all the required messages which should make a tooltip hidden. The tooltip visibility is usually based on mouse position rather than on focused window state.

Offer Har Aug 15, 2011 - 5:07 AM

Dear Support,


I found the flag m_bNoHideDetection. I use it and it seems to be exactly what I need... it shows the toolip until I move the dialog.


Can you give more details on this flag?


Thanks,

Ron

Offer Har Aug 14, 2011 - 11:47 AM

Where is this mouse position computed? Can it be hacked? or at least can I make it stay a little longer? I want the user to notice the message.


Thanks,


Ron.