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 » CExtPopupMenuTipWnd suggestion Collapse All
Subject Author Date
Rado Manzela Jun 28, 2011 - 9:04 AM

It would be good to improve CExtPopupMenuTipWnd::Show() in case the tip is already visible, instead of hiding and creating it again it would be better just to calculate new position and call MoveWindow() on existing window. I’m showing tooltip in my OnMouseMove() handler which updates tooltip’s text (and position) while I am moving over my custom drawn window. It works, but there is terrible flickering.

Thank you.

Technical Support Jun 29, 2011 - 12:08 PM

Tooltip control always display information for some screen region (typically rectangular). That’s why there is no flicker problem with tooltip. You need tooltip for single pixel region. You need to freeze tooltip window resizing when its text is changed and you want to move it manually. This means exactly the following: all the tooltip window features are turned off. It just paints itself. You don’t need automatic self hiding feature of tooltip control because your tooltip regions are single pixel. We can turn off all the handlers in Prof-UIS tooltip and let you move its window manually. This will remove flicker provided by ShowWindow() Win32 API. But some "tail" effects on the surface of your control will be always visible. Your control cannot be repainted immediately when some window is moved over it. The 100% flicker free solution is not to use popup/tooltip windows at all and paint information just inside client area of your control.

Technical Support Jun 28, 2011 - 9:38 AM

The flicker effect occurs because your control does not keep information about its hovered part. For example, the CExtGridWnd control keeps the CExtGridHitTestInfo object describing currently hovered grid cell. If the same grid cell is still under mouse pointer, then cell’s tooltip is not re-displayed. The CExtPopupMenuTipWnd window does not hide itself because it knows rectangular area where it was displayed last time. The feature you requested is not needed if your control always know all the details about its hovered part. But most of control always need to know details about hover hit testing. That’s why we never needed to move tooltip window. Besides, movement can be implemented for rectangular tooltip window only. It’s not acceptable for balloon tooltip window with pointing corner.

Rado Manzela Jun 29, 2011 - 1:24 AM

I am using __ETS_RECTANGLE_NO_ICON type and want to move tip all the time (each pixel can have different tip, like coordinates, color, etc.). It’s not most important thing I want to do, otherwise I’d implement it by myself, but I’d have to copy and redesign whole Show() implementation especially because of complex calculation of tip position which is hard wired in the Show() method. It’s just suggestion how could you improve it.
BTW I’ve tried to add this into your filtered grid sample:

void CFilteredGridWnd::OnMouseMove(UINT nFlags, CPoint point)
{
	GetCursorPos(&point);
	if (point != m_last)
	{
		m_last = point;
		CString tmp;
		tmp.Format("(%d,%d)",point.x,point.y);
		m_tip.SetText(tmp);
		m_tip.SetTipStyle(CExtPopupMenuTipWnd::__ETS_RECTANGLE_NO_ICON);
		m_tip.Show(this,CRect(point,CSize(10,10)),true);
	}

	CExtPPVW<CExtGridWnd>::OnMouseMove(nFlags, point);
}


The only difference is that in my app also background of tip is flickering, in yor grid sample background does not flicker, but text is still invisible while moving of the mouse.