comctl32: Fix tooltips uninitialized variables plus wrong positioning.

This commit is contained in:
Jason Edmeades 2007-08-14 21:48:27 +01:00 committed by Alexandre Julliard
parent da68f3943f
commit 2e72e102a6

View File

@ -569,15 +569,18 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
if (style & TTS_BALLOON) if (style & TTS_BALLOON)
{ {
ptfx = rc.left + ((rc.right - rc.left) / 2); ptfx = rc.left + ((rc.right - rc.left) / 2);
if(rect.top - size.cy >= 0)
/* CENTERTIP ballon tooltips default to below the field
if they fit on the screen */
if(rc.bottom + size.cy > GetSystemMetrics(SM_CYSCREEN))
{ {
rect.top -= size.cy; rect.top = rc.top - size.cy;
infoPtr->bToolBelow = FALSE; infoPtr->bToolBelow = FALSE;
} }
else else
{ {
infoPtr->bToolBelow = TRUE; infoPtr->bToolBelow = TRUE;
rect.top += 20; rect.top = rc.bottom;
} }
rect.left = max(0, rect.left - BALLOON_STEMINDENT); rect.left = max(0, rect.left - BALLOON_STEMINDENT);
} }