mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[0.4.7][COMCTL32] tooltips.c trivial log tweaks, no functional change
partially pick 0.4.8-dev-694-g edd99e8ccc
which (also) tweaked a few loggings. Take what was done for simplifying the ERR().
But strip entirely the TRACEs that were touched or had tab-indentation.
Also fuse 2 ifs into one, as it was done in that same commit.
No functional changes!
0.4.8 comctl32.dll RosBEWin2.1.6 GCC4.7.2dbg 1.634.304
0.4.7 comctl32.dll RosBEWin2.1.6 GCC4.7.2dbg 1.629.184 -> 1.624.576
This commit is contained in:
parent
0c09cd7e98
commit
cf099e2bce
1 changed files with 12 additions and 70 deletions
|
@ -392,7 +392,7 @@ static void TOOLTIPS_GetDispInfoA(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *too
|
|||
}
|
||||
}
|
||||
else {
|
||||
ERR("recursive text callback!\n");
|
||||
ERR("recursive text callback\n");
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ static void TOOLTIPS_GetDispInfoW(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *too
|
|||
}
|
||||
}
|
||||
else {
|
||||
ERR("recursive text callback!\n");
|
||||
ERR("recursive text callback\n");
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
||||
|
@ -475,9 +475,6 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
|
|||
TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
|
||||
|
||||
if (IS_INTRESOURCE(toolPtr->lpszText)) {
|
||||
/* load a resource */
|
||||
TRACE("load res string %p %x\n",
|
||||
toolPtr->hinst, LOWORD(toolPtr->lpszText));
|
||||
if (!LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE))
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
@ -582,24 +579,16 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
|||
if (track_activate)
|
||||
{
|
||||
if (infoPtr->nTrackTool == -1)
|
||||
{
|
||||
TRACE("invalid tracking tool (-1)!\n");
|
||||
return;
|
||||
}
|
||||
nTool = infoPtr->nTrackTool;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (infoPtr->nTool == -1)
|
||||
{
|
||||
TRACE("invalid tool (-1)!\n");
|
||||
return;
|
||||
}
|
||||
nTool = infoPtr->nTool;
|
||||
}
|
||||
|
||||
TRACE("Show tooltip pre %d! (%p)\n", nTool, infoPtr->hwndSelf);
|
||||
|
||||
TOOLTIPS_GetTipText (infoPtr, nTool, infoPtr->szTipText);
|
||||
|
||||
if (infoPtr->szTipText[0] == '\0')
|
||||
|
@ -610,8 +599,6 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
|||
if (!track_activate)
|
||||
infoPtr->nCurrentTool = infoPtr->nTool;
|
||||
|
||||
TRACE("Show tooltip %d!\n", nTool);
|
||||
|
||||
hdr.hwndFrom = infoPtr->hwndSelf;
|
||||
hdr.idFrom = toolPtr->uId;
|
||||
hdr.code = TTN_SHOW;
|
||||
|
@ -820,9 +807,7 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
|||
if (!track_activate)
|
||||
{
|
||||
SetTimer (infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
|
||||
TRACE("timer 2 started!\n");
|
||||
SetTimer (infoPtr->hwndSelf, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
|
||||
TRACE("timer 3 started!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -833,8 +818,6 @@ TOOLTIPS_Hide (TOOLTIPS_INFO *infoPtr)
|
|||
TTTOOL_INFO *toolPtr;
|
||||
NMHDR hdr;
|
||||
|
||||
TRACE("Hide tooltip %d! (%p)\n", infoPtr->nCurrentTool, infoPtr->hwndSelf);
|
||||
|
||||
if (infoPtr->nCurrentTool == -1)
|
||||
return;
|
||||
|
||||
|
@ -1011,9 +994,6 @@ TOOLTIPS_Activate (TOOLTIPS_INFO *infoPtr, BOOL activate)
|
|||
{
|
||||
infoPtr->bActive = activate;
|
||||
|
||||
if (infoPtr->bActive)
|
||||
TRACE("activate!\n");
|
||||
|
||||
if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
|
||||
TOOLTIPS_Hide (infoPtr);
|
||||
|
||||
|
@ -1029,10 +1009,6 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
|
||||
if (!ti) return FALSE;
|
||||
|
||||
TRACE("add tool (%p) %p %ld%s!\n",
|
||||
infoPtr->hwndSelf, ti->hwnd, ti->uId,
|
||||
(ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
|
||||
|
||||
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE && !ti->lpszText && isW)
|
||||
return FALSE;
|
||||
|
||||
|
@ -1067,27 +1043,25 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
}
|
||||
else if (ti->lpszText) {
|
||||
if (TOOLTIPS_IsCallbackString(ti->lpszText, isW)) {
|
||||
TRACE("add CALLBACK!\n");
|
||||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
}
|
||||
else if (isW) {
|
||||
__TRY
|
||||
{
|
||||
INT len = lstrlenW (ti->lpszText);
|
||||
TRACE("add text %s!\n", debugstr_w(ti->lpszText));
|
||||
TRACE("add text %s\n", debugstr_w(ti->lpszText));
|
||||
toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
|
||||
strcpyW (toolPtr->lpszText, ti->lpszText);
|
||||
}
|
||||
__EXCEPT_PAGE_FAULT
|
||||
{
|
||||
WARN("Invalid lpszText.\n");
|
||||
WARN("Invalid lpszText\n");
|
||||
return FALSE;
|
||||
}
|
||||
__ENDTRY
|
||||
}
|
||||
else {
|
||||
INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
|
||||
TRACE("add text \"%s\"!\n", (LPSTR)ti->lpszText);
|
||||
toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len);
|
||||
}
|
||||
|
@ -1107,19 +1081,14 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
SetWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1,
|
||||
(DWORD_PTR)infoPtr->hwndSelf);
|
||||
}
|
||||
TRACE("subclassing installed!\n");
|
||||
}
|
||||
|
||||
nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
|
||||
(WPARAM)infoPtr->hwndSelf, NF_QUERY);
|
||||
if (nResult == NFR_ANSI) {
|
||||
toolPtr->bNotifyUnicode = FALSE;
|
||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
|
||||
} else if (nResult == NFR_UNICODE) {
|
||||
toolPtr->bNotifyUnicode = TRUE;
|
||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
|
||||
} else {
|
||||
TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1220,8 +1189,7 @@ TOOLTIPS_EnumToolsT (const TOOLTIPS_INFO *infoPtr, UINT uIndex, TTTOOLINFOW *ti,
|
|||
{
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (!ti) return FALSE;
|
||||
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||
if (!ti || ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||
return FALSE;
|
||||
if (uIndex >= infoPtr->uNumTools)
|
||||
return FALSE;
|
||||
|
@ -1293,7 +1261,7 @@ TOOLTIPS_GetCurrentToolT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL is
|
|||
return FALSE;
|
||||
}
|
||||
else
|
||||
return (infoPtr->nCurrentTool != -1);
|
||||
return infoPtr->nCurrentTool != -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1442,8 +1410,6 @@ TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit,
|
|||
if (nTool == -1)
|
||||
return FALSE;
|
||||
|
||||
TRACE("tool %d!\n", nTool);
|
||||
|
||||
/* copy tool data */
|
||||
if (lptthit->ti.cbSize >= TTTOOLINFOW_V1_SIZE) {
|
||||
toolPtr = &infoPtr->tools[nTool];
|
||||
|
@ -1499,7 +1465,7 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
|||
INT nOldTool;
|
||||
|
||||
if (!lpMsg) {
|
||||
ERR("lpMsg == NULL!\n");
|
||||
ERR("lpMsg == NULL\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1519,10 +1485,6 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
|||
nOldTool = infoPtr->nTool;
|
||||
infoPtr->nTool = TOOLTIPS_GetToolFromPoint(infoPtr, lpMsg->hwnd,
|
||||
&pt);
|
||||
TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool,
|
||||
infoPtr->nTool, infoPtr->nCurrentTool);
|
||||
TRACE("WM_MOUSEMOVE (%p %s)\n", infoPtr->hwndSelf, wine_dbgstr_point(&pt));
|
||||
|
||||
if (infoPtr->nTool != nOldTool) {
|
||||
if(infoPtr->nTool == -1) { /* Moved out of all tools */
|
||||
TOOLTIPS_Hide(infoPtr);
|
||||
|
@ -1530,24 +1492,20 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
|||
} else if (nOldTool == -1) { /* Moved from outside */
|
||||
if(infoPtr->bActive) {
|
||||
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
||||
TRACE("timer 1 started!\n");
|
||||
}
|
||||
} else { /* Moved from one to another */
|
||||
TOOLTIPS_Hide (infoPtr);
|
||||
KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
|
||||
if(infoPtr->bActive) {
|
||||
SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
|
||||
TRACE("timer 1 started!\n");
|
||||
}
|
||||
}
|
||||
} else if(infoPtr->nCurrentTool != -1) { /* restart autopop */
|
||||
KillTimer(infoPtr->hwndSelf, ID_TIMERPOP);
|
||||
SetTimer(infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
|
||||
TRACE("timer 2 restarted\n");
|
||||
} else if(infoPtr->nTool != -1 && infoPtr->bActive) {
|
||||
/* previous show attempt didn't result in tooltip so try again */
|
||||
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
||||
TRACE("timer 1 started!\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1703,7 +1661,6 @@ TOOLTIPS_SetToolInfoT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
toolPtr->hinst = ti->hinst;
|
||||
|
||||
if (IS_INTRESOURCE(ti->lpszText)) {
|
||||
TRACE("set string id %x!\n", LOWORD(ti->lpszText));
|
||||
toolPtr->lpszText = ti->lpszText;
|
||||
}
|
||||
else {
|
||||
|
@ -1762,7 +1719,6 @@ TOOLTIPS_TrackActivate (TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOO
|
|||
/* activate */
|
||||
infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoT (infoPtr, (const TTTOOLINFOW*)ti);
|
||||
if (infoPtr->nTrackTool != -1) {
|
||||
TRACE("activated!\n");
|
||||
infoPtr->bTrackActive = TRUE;
|
||||
TOOLTIPS_TrackShow (infoPtr);
|
||||
}
|
||||
|
@ -1773,8 +1729,6 @@ TOOLTIPS_TrackActivate (TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOO
|
|||
|
||||
infoPtr->bTrackActive = FALSE;
|
||||
infoPtr->nTrackTool = -1;
|
||||
|
||||
TRACE("deactivated!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1787,12 +1741,8 @@ TOOLTIPS_TrackPosition (TOOLTIPS_INFO *infoPtr, LPARAM coord)
|
|||
infoPtr->xTrackPos = (INT)LOWORD(coord);
|
||||
infoPtr->yTrackPos = (INT)HIWORD(coord);
|
||||
|
||||
if (infoPtr->bTrackActive) {
|
||||
TRACE("[%d %d]\n",
|
||||
infoPtr->xTrackPos, infoPtr->yTrackPos);
|
||||
|
||||
if (infoPtr->bTrackActive)
|
||||
TOOLTIPS_TrackShow(infoPtr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1997,7 +1947,6 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if ((nTool > -1) && (nTool < infoPtr->uNumTools)) {
|
||||
if (infoPtr->tools[nTool].uFlags & TTF_TRANSPARENT) {
|
||||
TRACE("-- in transparent mode!\n");
|
||||
return HTTRANSPARENT;
|
||||
}
|
||||
}
|
||||
|
@ -2073,9 +2022,8 @@ TOOLTIPS_SetFont (TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw)
|
|||
lf.lfWeight = FW_BOLD;
|
||||
infoPtr->hTitleFont = CreateFontIndirectW(&lf);
|
||||
|
||||
if (redraw && infoPtr->nCurrentTool != -1) {
|
||||
FIXME("full redraw needed!\n");
|
||||
}
|
||||
if (redraw && infoPtr->nCurrentTool != -1)
|
||||
FIXME("full redraw needed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2124,8 +2072,6 @@ TOOLTIPS_Timer (TOOLTIPS_INFO *infoPtr, INT iTimer)
|
|||
{
|
||||
INT nOldTool;
|
||||
|
||||
TRACE("timer %d (%p) expired!\n", iTimer, infoPtr->hwndSelf);
|
||||
|
||||
switch (iTimer) {
|
||||
case ID_TIMERSHOW:
|
||||
KillTimer (infoPtr->hwndSelf, ID_TIMERSHOW);
|
||||
|
@ -2141,8 +2087,6 @@ TOOLTIPS_Timer (TOOLTIPS_INFO *infoPtr, INT iTimer)
|
|||
case ID_TIMERLEAVE:
|
||||
nOldTool = infoPtr->nTool;
|
||||
infoPtr->nTool = TOOLTIPS_CheckTool (infoPtr, FALSE);
|
||||
TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool,
|
||||
infoPtr->nTool, infoPtr->nCurrentTool);
|
||||
if (infoPtr->nTool != nOldTool) {
|
||||
if(infoPtr->nTool == -1) { /* Moved out of all tools */
|
||||
TOOLTIPS_Hide(infoPtr);
|
||||
|
@ -2154,7 +2098,6 @@ TOOLTIPS_Timer (TOOLTIPS_INFO *infoPtr, INT iTimer)
|
|||
KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
|
||||
if(infoPtr->bActive) {
|
||||
SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
|
||||
TRACE("timer 1 started!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2197,7 +2140,6 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_
|
|||
msg.lParam = lParam;
|
||||
TOOLTIPS_RelayEvent(infoPtr, &msg);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue