Changeset 3145 for trunk/src/comctl32/tooltips.cpp
- Timestamp:
- Mar 17, 2000, 6:13:26 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/tooltips.cpp
r2893 r3145 1 /* $Id: tooltips.cpp,v 1. 2 2000-02-25 09:57:19 achimhaExp $ */1 /* $Id: tooltips.cpp,v 1.3 2000-03-17 17:13:26 cbratschi Exp $ */ 2 2 /* 3 3 * Tool tip control … … 42 42 43 43 44 static VOID 45 TOOLTIPS_Refresh (HWND hwnd, HDC hdc) 44 static VOID TOOLTIPS_Draw (HWND hwnd, HDC hdc) 46 45 { 47 46 TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(hwnd); … … 170 169 } 171 170 if (GetWindowLongA(hwnd,GWL_STYLE) & TTS_NOPREFIX) uFlags |= DT_NOPREFIX; 172 //TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText));171 //TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText)); 173 172 174 173 hdc = GetDC(hwnd); … … 181 180 size.cy = rc.bottom-rc.top+4+infoPtr->rcMargin.bottom+infoPtr->rcMargin.top; 182 181 183 //CB: optimize184 185 182 if (toolPtr->uFlags & TTF_ABSOLUTE) 186 183 { … … 188 185 rc.top = infoPtr->yTrackPos; 189 186 190 if (toolPtr->uFlags & TTF_ CENTERTIP)187 if (toolPtr->uFlags & TTF_ALIGNMASK) 191 188 { 192 rc.left -= (size.cx/2); 193 rc.top -= (size.cy/2); 189 //CB: Odin only (Win32 does something similar but with an undocumented mechanism) 190 191 if (toolPtr->uFlags & TTF_ALIGNLEFT) 192 rc.left -= size.cx; 193 else if (toolPtr->uFlags & TTF_HCENTER) 194 rc.left -= size.cx/2; 195 196 if (toolPtr->uFlags & TTF_ALIGNTOP) 197 rc.top -= size.cy; 198 else if (toolPtr->uFlags & TTF_VCENTER) 199 rc.top -= size.cy/2; 200 201 } else 202 { 203 if (toolPtr->uFlags & TTF_CENTERTIP) 204 { 205 rc.left -= (size.cx/2); 206 rc.top -= (size.cy/2); 207 } 194 208 } 195 209 } else … … 235 249 } 236 250 237 //TRACE (tooltips, "pos %d - %d\n", rect.left, rect.top);251 //TRACE (tooltips, "pos %d - %d\n", rect.left, rect.top); 238 252 239 253 rc.right = rc.left+size.cx; … … 260 274 if (GetWindowLongA (hwnd, GWL_STYLE) & TTS_NOPREFIX) 261 275 uFlags |= DT_NOPREFIX; 262 //TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText));276 //TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText)); 263 277 264 278 hdc = GetDC (hwnd); … … 364 378 /* repaint the tooltip */ 365 379 hdc = GetDC (hwnd); 366 TOOLTIPS_ Refresh(hwnd, hdc);380 TOOLTIPS_Draw(hwnd, hdc); 367 381 ReleaseDC (hwnd, hdc); 368 382 … … 407 421 if (infoPtr->nTrackTool == -1) 408 422 { 409 //TRACE (tooltips, "invalid tracking tool (-1)!\n");423 //TRACE (tooltips, "invalid tracking tool (-1)!\n"); 410 424 return; 411 425 } 412 426 413 //TRACE (tooltips, "show tracking tooltip pre %d!\n", infoPtr->nTrackTool);427 //TRACE (tooltips, "show tracking tooltip pre %d!\n", infoPtr->nTrackTool); 414 428 415 429 TOOLTIPS_GetTipText(hwnd,infoPtr,infoPtr->nTrackTool); … … 421 435 } 422 436 423 //TRACE (tooltips, "show tracking tooltip %d!\n", infoPtr->nTrackTool);437 //TRACE (tooltips, "show tracking tooltip %d!\n", infoPtr->nTrackTool); 424 438 toolPtr = &infoPtr->tools[infoPtr->nTrackTool]; 425 439 … … 429 443 SendMessageA(toolPtr->hwnd,WM_NOTIFY,(WPARAM)toolPtr->uId,(LPARAM)&hdr); 430 444 431 //TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText));445 //TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText)); 432 446 433 447 TOOLTIPS_CalcTipRect(hwnd,infoPtr,toolPtr,&rect); … … 438 452 439 453 hdc = GetDC (hwnd); 440 TOOLTIPS_ Refresh(hwnd, hdc);454 TOOLTIPS_Draw(hwnd, hdc); 441 455 ReleaseDC (hwnd, hdc); 442 456 } … … 1740 1754 if (infoPtr->nTrackTool != -1) 1741 1755 { 1742 //TRACE (tooltips, "activated!\n");1756 //TRACE (tooltips, "activated!\n"); 1743 1757 infoPtr->bTrackActive = TRUE; 1744 1758 TOOLTIPS_TrackShow(hwnd,infoPtr); … … 1752 1766 infoPtr->nTrackTool = -1; 1753 1767 1754 //TRACE (tooltips, "deactivated!\n");1768 //TRACE (tooltips, "deactivated!\n"); 1755 1769 } 1756 1770 … … 2090 2104 2091 2105 hdc = (wParam == 0) ? BeginPaint (hwnd, &ps) : (HDC)wParam; 2092 TOOLTIPS_ Refresh(hwnd, hdc);2106 TOOLTIPS_Draw(hwnd, hdc); 2093 2107 if (!wParam) 2094 2108 EndPaint (hwnd, &ps); … … 2461 2475 WNDCLASSA wndClass; 2462 2476 2463 //SvL: Don't check this now2464 // if (GlobalFindAtomA (TOOLTIPS_CLASSA)) return;2465 2466 2477 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); 2467 2478 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS; … … 2480 2491 TOOLTIPS_Unregister (VOID) 2481 2492 { 2482 if (GlobalFindAtomA (TOOLTIPS_CLASSA)) 2483 UnregisterClassA (TOOLTIPS_CLASSA, (HINSTANCE)NULL); 2484 } 2485 2493 UnregisterClassA (TOOLTIPS_CLASSA, (HINSTANCE)NULL); 2494 } 2495
Note:
See TracChangeset
for help on using the changeset viewer.