comctl32: Fix the tooltips behaviour when TTF_ABSOLUTE isn't specified.

This does not mean to use the current cursor position. Instead, it means
that the left hand edge of balloon tips doesn't have to be exactly the
co-ordinate passed in (i.e. the stem can be as vertical as possible) and
it means non-balloon tips can use smart placement.
This commit is contained in:
Rob Shearman 2007-11-19 15:29:57 +00:00 committed by Alexandre Julliard
parent 5ff8e6d7e1
commit c6525745f2
1 changed files with 27 additions and 52 deletions

View File

@ -573,64 +573,39 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
if (track_activate)
{
if (toolPtr->uFlags & TTF_ABSOLUTE)
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
ptfx = rect.left;
if (toolPtr->uFlags & TTF_CENTERTIP)
{
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
ptfx = rect.left;
if (toolPtr->uFlags & TTF_CENTERTIP)
{
rect.left -= (size.cx / 2);
if (!(style & TTS_BALLOON))
rect.top -= (size.cy / 2);
}
infoPtr->bToolBelow = TRUE;
}
else
{
RECT rcTool;
GetCursorPos ((LPPOINT)&rect);
if (style & TTS_BALLOON)
{
ptfx = rect.left;
if (rect.top - size.cy >= 0)
{
rect.top -= size.cy;
infoPtr->bToolBelow = FALSE;
}
else
{
infoPtr->bToolBelow = TRUE;
rect.top += 20;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
}
else
{
rect.top += 20;
infoPtr->bToolBelow = TRUE;
}
if (toolPtr->uFlags & TTF_CENTERTIP)
{
rect.left -= (size.cx / 2);
rect.left -= (size.cx / 2);
if (!(style & TTS_BALLOON))
rect.top -= (size.cy / 2);
}
}
infoPtr->bToolBelow = TRUE;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
if (!(toolPtr->uFlags & TTF_ABSOLUTE))
{
if (style & TTS_BALLOON)
rect.left -= BALLOON_STEMINDENT;
else
{
rcTool = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rcTool, 2);
}
RECT rcTool;
/* smart placement */
if ((rect.left + size.cx > rcTool.left) && (rect.left < rcTool.right) &&
(rect.top + size.cy > rcTool.top) && (rect.top < rcTool.bottom))
rect.left = rcTool.right;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
else
{
rcTool = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rcTool, 2);
}
/* smart placement */
if ((rect.left + size.cx > rcTool.left) && (rect.left < rcTool.right) &&
(rect.top + size.cy > rcTool.top) && (rect.top < rcTool.bottom))
rect.left = rcTool.right;
}
}
}
else