- Timestamp:
- Mar 17, 2000, 6:13:26 PM (25 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/CCBase.cpp
r2895 r3145 1 /* $Id: CCBase.cpp,v 1. 2 2000-02-25 17:00:15cbratschi Exp $ */1 /* $Id: CCBase.cpp,v 1.3 2000-03-17 17:13:22 cbratschi Exp $ */ 2 2 /* 3 3 * COMCTL32 Base Functions and Macros for all Controls … … 35 35 infoPtr->fUnicode = IsWindowUnicode(hwnd); 36 36 infoPtr->uNotifyFormat = sendNotifyFormat(GetParent(hwnd),hwnd,NF_QUERY); 37 infoPtr->hwndNotify = GetParent(hwnd); 37 38 38 39 return infoPtr; … … 109 110 break; 110 111 } 112 113 case CCM_SETNOTIFYWINDOW: 114 { 115 infoPtr = getInfoPtr(hwnd); 116 117 if (!infoPtr) break; 118 119 infoPtr->hwndNotify = (HWND)wParam; 120 121 break; 122 } 111 123 } 112 124 … … 143 155 } 144 156 157 HWND getNotifyWindow(COMCTL32_HEADER *infoPtr) 158 { 159 if (!infoPtr) return 0; 160 161 return infoPtr->hwndNotify; 162 } 163 164 HWND getNotifyWindow(HWND hwnd) 165 { 166 COMCTL32_HEADER *infoPtr = getInfoPtr(hwnd); 167 168 return getNotifyWindow(infoPtr); 169 } 170 145 171 LRESULT sendNotify(HWND hwnd,UINT code) 146 172 { … … 151 177 nmhdr.code = code; 152 178 153 return SendMessageA( GetParent(hwnd),WM_NOTIFY,nmhdr.idFrom,(LPARAM)&nmhdr);179 return SendMessageA(getNotifyWindow(hwnd),WM_NOTIFY,nmhdr.idFrom,(LPARAM)&nmhdr); 154 180 } 155 181 … … 162 188 nmhdr->code = code; 163 189 164 return SendMessageA( GetParent(hwnd),WM_NOTIFY,nmhdr->idFrom,(LPARAM)nmhdr);190 return SendMessageA(getNotifyWindow(hwnd),WM_NOTIFY,nmhdr->idFrom,(LPARAM)nmhdr); 165 191 } 166 192 … … 172 198 LRESULT sendCommand(HWND hwnd,UINT wNotifyCode) 173 199 { 174 return SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetWindowLongA(hwnd,GWL_ID),wNotifyCode),(LPARAM)hwnd); 200 return SendMessageA(getNotifyWindow(hwnd),WM_COMMAND,MAKEWPARAM(GetWindowLongA(hwnd,GWL_ID),wNotifyCode),(LPARAM)hwnd); 201 } 202 203 LRESULT sendHScroll(HWND hwnd,UINT wNotifyCode) 204 { 205 return SendMessageA(getNotifyWindow(hwnd),WM_HSCROLL,(WPARAM)wNotifyCode,(LPARAM)hwnd); 206 } 207 208 LRESULT sendVScroll(HWND hwnd,UINT wNotifyCode) 209 { 210 return SendMessageA(getNotifyWindow(hwnd),WM_VSCROLL,(WPARAM)wNotifyCode,(LPARAM)hwnd); 175 211 } 176 212 -
trunk/src/comctl32/CCBase.h
r2895 r3145 1 /* $Id: CCBase.h,v 1. 3 2000-02-25 17:00:15cbratschi Exp $ */1 /* $Id: CCBase.h,v 1.4 2000-03-17 17:13:22 cbratschi Exp $ */ 2 2 /* 3 3 * COMCTL32 Base Functions and Macros for all Controls … … 17 17 BOOL fUnicode; //Unicode flag 18 18 UINT uNotifyFormat; //notify format 19 HWND hwndNotify; //notify window 19 20 } COMCTL32_HEADER; 20 21 … … 28 29 BOOL isUnicodeNotify(HWND hwnd); 29 30 31 HWND getNotifyWindow(COMCTL32_HEADER *infoPtr); 32 HWND getNotifyWindow(COMCTL32_HEADER *infoPtr); 33 30 34 LRESULT sendNotify(HWND hwnd,UINT code); 31 35 LRESULT sendNotify(HWND hwnd,UINT code,LPNMHDR nmhdr); 32 36 LRESULT sendNotifyFormat(HWND hwnd,HWND hwndFrom,LPARAM command); 33 37 LRESULT sendCommand(HWND hwnd,UINT wNotifyCode); 38 LRESULT sendHScroll(HWND hwnd,UINT wNotifyCode); 39 LRESULT sendVScroll(HWND hwnd,UINT wNotifyCode); 34 40 35 41 HWND createToolTip(HWND hwnd,UINT flags); -
trunk/src/comctl32/monthcal.cpp
r2875 r3145 24 24 #include "commctrl.h" 25 25 #include "comctl32.h" 26 #include "ccbase.h" 26 27 #include "monthcal.h" 27 28 #include "winnls.h" … … 45 46 46 47 47 #define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *) GetWindowLongA(hwnd, 0))48 #define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)getInfoPtr(hwnd)) 48 49 49 50 /* helper functions */ … … 1095 1096 int i; 1096 1097 1097 nmds.nmhdr.hwndFrom = hwnd;1098 nmds.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);1099 nmds.nmhdr.code = MCN_GETDAYSTATE;1100 1098 nmds.cDayState = infoPtr->monthRange; 1101 1099 nmds.prgDayState = (DWORD*)COMCTL32_Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); 1102 1100 1103 SendMessageA(GetParent(hwnd), WM_NOTIFY, 1104 (WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds); 1101 sendNotify(hwnd,MCN_GETDAYSTATE,&nmds.nmhdr); 1105 1102 for(i=0; i<infoPtr->monthRange; i++) 1106 1103 infoPtr->monthdayState[i] = nmds.prgDayState[i]; … … 1125 1122 int i; 1126 1123 1127 nmds.nmhdr.hwndFrom = hwnd;1128 nmds.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);1129 nmds.nmhdr.code = MCN_GETDAYSTATE;1130 1124 nmds.cDayState = infoPtr->monthRange; 1131 1125 nmds.prgDayState = (DWORD*)COMCTL32_Alloc 1132 1126 (infoPtr->monthRange * sizeof(MONTHDAYSTATE)); 1133 1127 1134 SendMessageA(GetParent(hwnd), WM_NOTIFY, 1135 (WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds); 1128 sendNotify(hwnd,MCN_GETDAYSTATE,&nmds.nmhdr); 1136 1129 for(i=0; i<infoPtr->monthRange; i++) 1137 1130 infoPtr->monthdayState[i] = nmds.prgDayState[i]; … … 1209 1202 1210 1203 //TRACE("\n"); 1211 nmsc.nmhdr.hwndFrom = hwnd;1212 nmsc.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);1213 nmsc.nmhdr.code = MCN_SELCHANGE;1214 1204 MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); 1215 1205 MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); 1216 1206 1217 SendMessageA(GetParent(hwnd), WM_NOTIFY, 1218 (WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc); 1207 sendNotify(hwnd,MCN_SELCHANGE,&nmsc.nmhdr); 1219 1208 1220 1209 MONTHCAL_CopyTime(&ht.st, &selArray[0]); … … 1248 1237 MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); 1249 1238 NMSELCHANGE nmsc; 1250 NMHDR nmhdr;1251 1239 HDC hdc; 1252 1240 BOOL redraw = FALSE; … … 1265 1253 infoPtr->status = MC_SEL_LBUTUP; 1266 1254 1267 nmhdr.hwndFrom = hwnd; 1268 nmhdr.idFrom = GetWindowLongA( hwnd, GWL_ID); 1269 nmhdr.code = NM_RELEASEDCAPTURE; 1270 //TRACE("Sent notification from %x to %x\n", hwnd, GetParent(hwnd)); 1271 1272 SendMessageA(GetParent(hwnd), WM_NOTIFY, 1273 (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); 1274 1275 nmsc.nmhdr.hwndFrom = hwnd; 1276 nmsc.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID); 1277 nmsc.nmhdr.code = MCN_SELECT; 1255 sendNotify(hwnd,NM_RELEASEDCAPTURE); 1256 1278 1257 MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); 1279 1258 MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); 1280 1259 1281 SendMessageA(GetParent(hwnd), WM_NOTIFY, 1282 (WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc); 1260 sendNotify(hwnd,MCN_SELECT,&nmsc.nmhdr); 1283 1261 1284 1262 /* redraw if necessary */ … … 1569 1547 1570 1548 /* allocate memory for info structure */ 1571 infoPtr =(MONTHCAL_INFO*)COMCTL32_Alloc(sizeof(MONTHCAL_INFO)); 1572 SetWindowLongA(hwnd, 0, (DWORD)infoPtr); 1549 infoPtr =(MONTHCAL_INFO*)initControl(hwnd,sizeof(MONTHCAL_INFO)); 1573 1550 1574 1551 if(infoPtr == NULL) { … … 1620 1597 1621 1598 /* free month calendar info data */ 1622 COMCTL32_Free(infoPtr);1599 doneControl(hwnd); 1623 1600 1624 1601 return 0; … … 1730 1707 //if(uMsg >= WM_USER) 1731 1708 // ERR( "unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam); 1732 return DefWindowProcA(hwnd, uMsg, wParam, lParam);1709 return defComCtl32ProcA(hwnd, uMsg, wParam, lParam); 1733 1710 } 1734 1711 return 0; … … 1740 1717 { 1741 1718 WNDCLASSA wndClass; 1742 1743 //SvL: Don't check this now1744 // if(GlobalFindAtomA(MONTHCAL_CLASSA)) return;1745 1719 1746 1720 ZeroMemory(&wndClass, sizeof(WNDCLASSA)); … … 1760 1734 MONTHCAL_Unregister(void) 1761 1735 { 1762 if(GlobalFindAtomA(MONTHCAL_CLASSA)) 1763 UnregisterClassA(MONTHCAL_CLASSA, (HINSTANCE)NULL); 1764 } 1736 UnregisterClassA(MONTHCAL_CLASSA, (HINSTANCE)NULL); 1737 } -
trunk/src/comctl32/nativefont.cpp
r2875 r3145 1 /* $Id: nativefont.cpp,v 1. 1 2000-02-23 17:09:44cbratschi Exp $ */1 /* $Id: nativefont.cpp,v 1.2 2000-03-17 17:13:23 cbratschi Exp $ */ 2 2 /* 3 3 * Native Font control … … 18 18 #include "winbase.h" 19 19 #include "commctrl.h" 20 #include "ccbase.h" 20 21 #include "nativefont.h" 21 22 22 23 24 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0)) 25 26 27 23 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO*)getInfoPtr(hwnd)) 28 24 29 25 static LRESULT … … 33 29 34 30 /* allocate memory for info structure */ 35 infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO)); 36 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 31 infoPtr = (NATIVEFONT_INFO*)initControl(hwnd,sizeof(NATIVEFONT_INFO)); 37 32 38 33 … … 53 48 54 49 /* free comboex info data */ 55 COMCTL32_Free (infoPtr);50 doneControl(hwnd); 56 51 57 52 return 0; … … 75 70 // ERR (nativefont, "unknown msg %04x wp=%08x lp=%08lx\n", 76 71 // uMsg, wParam, lParam); 77 return DefWindowProcA (hwnd, uMsg, wParam, lParam);72 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 78 73 } 79 74 return 0; … … 85 80 { 86 81 WNDCLASSA wndClass; 87 88 //SvL: Don't check this now89 // if (GlobalFindAtomA (WC_NATIVEFONTCTLA)) return;90 82 91 83 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 105 97 NATIVEFONT_Unregister (VOID) 106 98 { 107 if (GlobalFindAtomA (WC_NATIVEFONTCTLA)) 108 UnregisterClassA (WC_NATIVEFONTCTLA, (HINSTANCE)NULL); 99 UnregisterClassA (WC_NATIVEFONTCTLA, (HINSTANCE)NULL); 109 100 } 110 101 -
trunk/src/comctl32/pager.cpp
r2875 r3145 1 /* $Id: pager.cpp,v 1. 1 2000-02-23 17:09:45cbratschi Exp $ */1 /* $Id: pager.cpp,v 1.2 2000-03-17 17:13:23 cbratschi Exp $ */ 2 2 /* 3 3 * Pager control … … 18 18 #include "winbase.h" 19 19 #include "commctrl.h" 20 #include "ccbase.h" 20 21 #include "pager.h" 21 22 22 23 #define PAGER_GetInfoPtr(hwnd) ((PAGER_INFO *)GetWindowLongA(hwnd, 0)) 24 23 #define PAGER_GetInfoPtr(hwnd) ((PAGER_INFO*)getInfoPtr(hwnd)) 25 24 26 25 static LRESULT … … 94 93 if (infoPtr->hwndChild) { 95 94 ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE)); 96 nmpgcs.hdr.hwndFrom = hwnd;97 nmpgcs.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);98 nmpgcs.hdr.code = PGN_CALCSIZE;99 95 nmpgcs.dwFlag = (dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT; 100 SendMessageA (GetParent (hwnd), WM_NOTIFY, 101 (WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs); 96 sendNotify(hwnd,PGN_CALCSIZE,&nmpgcs.hdr); 102 97 103 98 infoPtr->nChildSize = (dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight; … … 205 200 206 201 /* allocate memory for info structure */ 207 infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));202 infoPtr = (PAGER_INFO*)initControl(hwnd,sizeof(PAGER_INFO)); 208 203 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 209 204 … … 225 220 PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); 226 221 227 228 229 230 222 /* free pager info data */ 231 COMCTL32_Free (infoPtr);223 doneControl(hwnd); 232 224 233 225 return 0; … … 356 348 // ERR (pager, "unknown msg %04x wp=%08x lp=%08lx\n", 357 349 // uMsg, wParam, lParam); 358 return DefWindowProcA (hwnd, uMsg, wParam, lParam);350 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 359 351 } 360 352 return 0; … … 366 358 { 367 359 WNDCLASSA wndClass; 368 369 //SvL: Don't check this now370 // if (GlobalFindAtomA (WC_PAGESCROLLERA)) return;371 360 372 361 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 386 375 PAGER_Unregister (VOID) 387 376 { 388 if (GlobalFindAtomA (WC_PAGESCROLLERA)) 389 UnregisterClassA (WC_PAGESCROLLERA, (HINSTANCE)NULL); 390 } 391 377 UnregisterClassA (WC_PAGESCROLLERA, (HINSTANCE)NULL); 378 } 379 -
trunk/src/comctl32/progress.cpp
r2875 r3145 1 /* $Id: progress.cpp,v 1. 1 2000-02-23 17:09:46cbratschi Exp $ */1 /* $Id: progress.cpp,v 1.2 2000-03-17 17:13:23 cbratschi Exp $ */ 2 2 /* 3 3 * Progress control … … 14 14 #include "winbase.h" 15 15 #include "commctrl.h" 16 #include "ccbase.h" 16 17 #include "progress.h" 17 18 #include "comctl32.h" 18 19 19 20 20 /* Control configuration constants */ 21 21 … … 23 23 #define BORDER_WIDTH 1 24 24 25 #define PROGRESS_GetInfoPtr(hwnd) ((PROGRESS_INFO *)GetWindowLongA(hwnd,0))25 #define PROGRESS_GetInfoPtr(hwnd) ((PROGRESS_INFO*)getInfoPtr(hwnd)) 26 26 27 27 … … 279 279 280 280 /* allocate memory for info struct */ 281 infoPtr = (PROGRESS_INFO *)COMCTL32_Alloc(sizeof(PROGRESS_INFO));281 infoPtr = (PROGRESS_INFO*)initControl(hwnd,sizeof(PROGRESS_INFO)); 282 282 SetWindowLongA(hwnd,0,(DWORD)infoPtr); 283 283 … … 290 290 infoPtr->ColorBk = CLR_DEFAULT; 291 291 infoPtr->hFont = (HANDLE)NULL; 292 // TRACE(progress, "Progress Ctrl creation, hwnd=%04x\n", hwnd);293 292 294 293 return 0; … … 299 298 PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(hwnd); 300 299 301 // TRACE (progress, "Progress Ctrl destruction, hwnd=%04x\n", hwnd); 302 COMCTL32_Free (infoPtr); 300 doneControl(hwnd); 303 301 304 302 return 0; … … 536 534 // ERR(progress, "unknown msg %04x wp=%04x lp=%08lx\n", 537 535 // message, wParam, lParam ); 538 return DefWindowProcA( hwnd, message, wParam, lParam );536 return defComCtl32ProcA( hwnd, message, wParam, lParam ); 539 537 } 540 538 … … 553 551 { 554 552 WNDCLASSA wndClass; 555 556 //SvL: Don't check this now557 // if (GlobalFindAtomA(PROGRESS_CLASSA)) return;558 553 559 554 ZeroMemory (&wndClass, sizeof( WNDCLASSA)); … … 578 573 PROGRESS_Unregister (VOID) 579 574 { 580 if (GlobalFindAtomA(PROGRESS_CLASSA)) 581 UnregisterClassA(PROGRESS_CLASSA, (HINSTANCE)NULL); 582 } 583 575 UnregisterClassA(PROGRESS_CLASSA, (HINSTANCE)NULL); 576 } 577 -
trunk/src/comctl32/propsheet.cpp
r2875 r3145 1 /* $Id: propsheet.cpp,v 1. 1 2000-02-23 17:09:46cbratschi Exp $ */1 /* $Id: propsheet.cpp,v 1.2 2000-03-17 17:13:24 cbratschi Exp $ */ 2 2 /* 3 3 * Property Sheets … … 20 20 #include "prsht.h" 21 21 #include "dialog.h" 22 #include "win.h"23 22 #include "winnls.h" 24 23 #include "comctl32.h" … … 349 348 static INT PROPSHEET_DoDialogBox( HWND hwnd, HWND owner) 350 349 { 351 WND * wndPtr;352 350 DIALOGINFO * dlgInfo; 353 351 MSG msg; 354 352 INT retval; 355 353 356 //AH: that WINE internal - design violation!!1 357 #if 0 354 dprintf(("PROPSHEET: PROPSHEET_DoDialogBox not implemented!!!")); 355 356 #if 0 //CB: implement! sync with user32\win32dlg.cpp DoDialogBox method (not easy) 357 // this functions isn't used so far 358 358 /* Owner must be a top-level window */ 359 359 owner = WIN_GetTopParent( owner ); 360 if (! (wndPtr = WIN_FindWndPtr( hwnd))) return -1;361 dlgInfo = (DIALOGINFO 360 if (!IsWindow(hwnd))) return -1; 361 dlgInfo = (DIALOGINFO*)wndPtr->wExtra; 362 362 363 363 if (!dlgInfo->flags & DF_END) /* was EndDialog called in WM_INITDIALOG ? */ … … 377 377 } 378 378 retval = dlgInfo->idResult; 379 380 WIN_ReleaseWndPtr(wndPtr);381 379 #endif 382 380 DestroyWindow( hwnd ); … … 390 388 */ 391 389 392 //AH: WINE 9912123 not merged due to design violation (internal WINE structures used)393 394 390 BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo) 395 391 { 396 #if 0397 LRESULT ret;398 LPCVOID template;399 LPVOID temp = 0;400 HRSRC hRes;401 DWORD resSize;402 WORD resID = IDD_PROPSHEET;403 404 if (psInfo->ppshheader->dwFlags & PSH_WIZARD)405 resID = IDD_WIZARD;406 407 if(!(hRes = FindResourceA(COMCTL32_hModule,408 MAKEINTRESOURCEA(resID),409 RT_DIALOGA)))410 return FALSE;411 412 if(!(template = (LPVOID)LoadResource(COMCTL32_hModule, hRes)))413 return FALSE;414 415 /*416 * Make a copy of the dialog template.417 */418 resSize = SizeofResource(COMCTL32_hModule, hRes);419 420 temp = COMCTL32_Alloc(resSize);421 422 if (!temp)423 return FALSE;424 425 memcpy(temp, template, resSize);426 427 if (psInfo->useCallback)428 (*(psInfo->ppshheader->pfnCallback))(0, PSCB_PRECREATE, (LPARAM)temp);429 430 ret = CreateDialogIndirectParamA(psInfo->ppshheader->hInstance,431 (LPDLGTEMPLATEA) temp,432 psInfo->ppshheader->hwndParent,433 (DLGPROC) PROPSHEET_DialogProc,434 (LPARAM)psInfo);435 436 if (!(psInfo->ppshheader->dwFlags & PSH_MODELESS))437 ret = PROPSHEET_DoDialogBox((HWND)ret, psInfo->ppshheader->hwndParent);438 439 COMCTL32_Free(temp);440 441 return ret;442 #endif443 392 LRESULT ret; 444 393 LPCVOID templ; -
trunk/src/comctl32/toolbar.cpp
r2875 r3145 1 /* $Id: toolbar.cpp,v 1. 1 2000-02-23 17:09:48cbratschi Exp $ */1 /* $Id: toolbar.cpp,v 1.2 2000-03-17 17:13:24 cbratschi Exp $ */ 2 2 /* 3 3 * Toolbar control … … 1613 1613 } 1614 1614 1615 //WINE version - not currently used1616 #if 01617 static BOOL WINAPI1618 TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)1619 {1620 TOOLBAR_INFO *infoPtr = (TOOLBAR_INFO *)GetWindowLongA (hwnd, DWL_USER);1621 static HDSA hDsa = NULL;1622 1623 switch (uMsg)1624 {1625 case WM_INITDIALOG:1626 infoPtr = (TOOLBAR_INFO *)lParam;1627 SetWindowLongA (hwnd, DWL_USER, (DWORD)infoPtr);1628 1629 hDsa = DSA_Create (sizeof(TBUTTON_INFO), 5);1630 1631 if (infoPtr)1632 {1633 TBUTTON_INFO *btnPtr;1634 INT i;1635 1636 /* insert 'virtual' separator button into 'available buttons' list */1637 SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");1638 1639 /* copy all buttons and append them to the right listbox */1640 btnPtr = infoPtr->buttons;1641 for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)1642 {1643 DSA_InsertItem (hDsa, i, btnPtr);1644 1645 /* FIXME: hidden buttons appear in the 'toolbar buttons' list too */1646 if (btnPtr->fsState & TBSTATE_HIDDEN)1647 {1648 SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");1649 }1650 else1651 {1652 SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");1653 }1654 }1655 1656 /* append 'virtual' separator button to the 'toolbar buttons' list */1657 /* TODO */1658 }1659 return TRUE;1660 1661 case WM_CLOSE:1662 EndDialog(hwnd, FALSE);1663 return TRUE;1664 1665 case WM_COMMAND:1666 switch (LOWORD(wParam))1667 {1668 case IDCANCEL:1669 EndDialog(hwnd, FALSE);1670 break;1671 }1672 return TRUE;1673 1674 case WM_DESTROY:1675 if (hDsa)1676 DSA_Destroy (hDsa);1677 return TRUE;1678 1679 case WM_DRAWITEM:1680 if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)1681 {1682 LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;1683 TBUTTON_INFO btnPtr;1684 RECT rcButton;1685 RECT rcText;1686 HPEN hOldPen;1687 HBRUSH hOldBrush;1688 COLORREF oldText = 0;1689 COLORREF oldBk = 0;1690 1691 FIXME("action: %x itemState: %x\n",1692 lpdis->itemAction, lpdis->itemState);1693 1694 DSA_GetItem (hDsa, 0 /*lpdis->itemID*/, &btnPtr);1695 1696 if (lpdis->itemState & ODS_FOCUS)1697 {1698 oldBk = SetBkColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));1699 oldText = SetTextColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));1700 }1701 1702 hOldPen = SelectObject (lpdis->hDC, GetSysColorPen ((lpdis->itemState & ODS_SELECTED)?COLOR_HIGHLIGHT:COLOR_WINDOW));1703 hOldBrush = SelectObject (lpdis->hDC, GetSysColorBrush ((lpdis->itemState & ODS_FOCUS)?COLOR_HIGHLIGHT:COLOR_WINDOW));1704 1705 /* fill background rectangle */1706 Rectangle (lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,1707 lpdis->rcItem.right, lpdis->rcItem.bottom);1708 1709 /* calculate button and text rectangles */1710 CopyRect (&rcButton, &lpdis->rcItem);1711 InflateRect (&rcButton, -1, -1);1712 CopyRect (&rcText, &rcButton);1713 rcButton.right = rcButton.left + infoPtr->nBitmapWidth + 6;1714 rcText.left = rcButton.right + 2;1715 1716 /* draw focus rectangle */1717 if (lpdis->itemState & ODS_FOCUS)1718 DrawFocusRect (lpdis->hDC, &lpdis->rcItem);1719 1720 /* draw button */1721 DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);1722 1723 /* draw image and text */1724 if (wParam == IDC_AVAILBTN_LBOX && lpdis->itemID == 0)1725 {1726 /* virtual separator in the 'available' list */1727 DrawTextA (lpdis->hDC, "Separator", -1, &rcText,1728 DT_LEFT | DT_VCENTER | DT_SINGLELINE);1729 }1730 else1731 {1732 /* real button */1733 1734 ImageList_Draw (infoPtr->himlDef, btnPtr.iBitmap, lpdis->hDC,1735 rcButton.left+1, rcButton.top+1, ILD_NORMAL);1736 //AH: TODO: Find out why this happens!!!1737 if ((infoPtr->strings == NULL) || (infoPtr->strings[btnPtr.iString] == NULL))1738 dprintf(("COMCTL32:TOOLBAR:CustomizeDialog - Error drawing string - pointer not found!\n"));1739 else1740 DrawTextW (lpdis->hDC, infoPtr->strings[btnPtr.iString], -1, &rcText,1741 DT_LEFT | DT_VCENTER | DT_SINGLELINE);1742 1743 }1744 1745 if (lpdis->itemState & ODS_FOCUS)1746 {1747 SetBkColor (lpdis->hDC, oldBk);1748 SetTextColor (lpdis->hDC, oldText);1749 }1750 1751 SelectObject (lpdis->hDC, hOldBrush);1752 SelectObject (lpdis->hDC, hOldPen);1753 1754 return TRUE;1755 }1756 return FALSE;1757 1758 case WM_MEASUREITEM:1759 if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)1760 {1761 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;1762 1763 if (infoPtr)1764 lpmis->itemHeight = infoPtr->nBitmapHeight + 8;1765 else1766 lpmis->itemHeight = 16 + 8; /* default height */1767 1768 return TRUE;1769 }1770 return FALSE;1771 1772 default:1773 return FALSE;1774 }1775 }1776 #endif1777 1778 1779 1615 /*********************************************************************** 1780 1616 * TOOLBAR_AddBitmap: Add the bitmaps to the default image list. -
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 -
trunk/src/comctl32/trackbar.cpp
r2875 r3145 1 /* $Id: trackbar.cpp,v 1. 1 2000-02-23 17:09:49cbratschi Exp $ */1 /* $Id: trackbar.cpp,v 1.2 2000-03-17 17:13:26 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 18 18 #include "winbase.h" 19 19 #include "commctrl.h" 20 #include "ccbase.h" 20 21 #include "trackbar.h" 21 22 #include <stdio.h> 22 23 23 #define TRACKBAR_GetInfoPtr(hwnd) ((TRACKBAR_INFO*) GetWindowLongA(hwnd,0))24 #define TRACKBAR_GetInfoPtr(hwnd) ((TRACKBAR_INFO*)getInfoPtr(hwnd)) 24 25 25 26 … … 60 61 #define CHANNEL_SCALE_SPACE SCALE_SIZE+SCALE_SPACE+BORDER_SIZE 61 62 #define CHANNEL_THUMB_SPACE BORDER_SIZE 63 64 #define TOOLTIP_SPACE 5 62 65 63 66 /* scroll mode */ … … 705 708 706 709 //Custom draw 707 cdraw.hdr.hwndFrom = hwnd;708 cdraw.hdr.idFrom = GetWindowLongA(hwnd,GWL_ID);709 cdraw.hdr.code = NM_CUSTOMDRAW;710 710 cdraw.dwDrawStage = CDDS_PREPAINT; 711 711 cdraw.hdc = hdc; … … 715 715 cdraw.lItemlParam = 0; 716 716 717 cdctlres = SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);717 cdctlres = sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 718 718 719 719 if (cdctlres & CDRF_SKIPDEFAULT) return; … … 750 750 cdraw.rc = infoPtr->rcChannel; 751 751 752 cdres = SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);752 cdres = sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 753 753 } else cdres = 0; 754 754 … … 777 777 cdraw.dwDrawStage = CDDS_ITEMPOSTPAINT; 778 778 779 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);779 sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 780 780 } 781 781 } … … 789 789 SetRectEmpty(&cdraw.rc); 790 790 791 cdres = SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);791 cdres = sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 792 792 } else cdres = 0; 793 793 … … 840 840 cdraw.dwDrawStage = CDDS_ITEMPOSTPAINT; 841 841 842 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);842 sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 843 843 } 844 844 } … … 852 852 cdraw.rc = infoPtr->rcFullThumb; 853 853 854 cdres = SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);854 cdres = sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 855 855 } else cdres = 0; 856 856 … … 863 863 cdraw.dwDrawStage = CDDS_ITEMPOSTPAINT; 864 864 865 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);865 sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 866 866 } 867 867 … … 876 876 GetClientRect(hwnd,&cdraw.rc); 877 877 878 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)cdraw.hdr.idFrom,(LPARAM)&cdraw);878 sendNotify(hwnd,NM_CUSTOMDRAW,&cdraw.hdr); 879 879 } 880 880 … … 977 977 978 978 GetWindowRect(hwnd,&rcSelf); 979 MapWindowPoints(HWND_DESKTOP,hwndParent,(LPPOINT)&rcSelf,2); 979 980 980 981 /* align buddy left or above */ … … 985 986 if (dwStyle & TBS_VERT) 986 987 { //above 987 x = rcSelf.left-(rcBuddy.right-rcBuddy.left)/2+infoPtr->rcChannel.left+(infoPtr->rcChannel.right-infoPtr->rcChannel.left)/2;988 988 x = (infoPtr->rcChannel.right+infoPtr->rcChannel.left)/2-(rcBuddy.right-rcBuddy.left)/2+rcSelf.left; 989 y = rcSelf.top-(rcBuddy.bottom-rcBuddy.top); 989 990 } else 990 991 { //left 991 x = rcSelf.left+infoPtr->rcChannel.left-(rcBuddy.right-rcBuddy.left)/2;992 y = rcSelf.top-(rcBuddy.bottom-rcBuddy.top);992 x = rcSelf.left-(rcBuddy.right-rcBuddy.left); 993 y = (infoPtr->rcChannel.bottom+infoPtr->rcChannel.top)/2-(rcBuddy.bottom-rcBuddy.top)/2+rcSelf.top; 993 994 } 994 995 … … 1004 1005 if (dwStyle & TBS_VERT) 1005 1006 { //below 1006 x = rcSelf.left-(rcBuddy.right-rcBuddy.left)/2+infoPtr->rcChannel.left+(infoPtr->rcChannel.right-infoPtr->rcChannel.left)/2;1007 1007 x = (infoPtr->rcChannel.right+infoPtr->rcChannel.left)/2-(rcBuddy.right-rcBuddy.left)/2+rcSelf.left; 1008 y = rcSelf.bottom; 1008 1009 } else 1009 { 1010 x = rcSelf.right -infoPtr->rcChannel.left-(rcBuddy.right-rcBuddy.left)/2;1011 y = rcSelf.top-(rcBuddy.bottom-rcBuddy.top);1010 { //right 1011 x = rcSelf.right; 1012 y = (infoPtr->rcChannel.bottom+infoPtr->rcChannel.top)/2-(rcBuddy.bottom-rcBuddy.top)/2+rcSelf.top; 1012 1013 } 1013 1014 … … 1227 1228 } 1228 1229 1229 1230 static1231 TRACKBAR_GetUnicodeFormat(HWND hwnd,WPARAM wParam,LPARAM lParam)1232 {1233 return FALSE; //Unicode not used1234 }1235 1230 1236 1231 static LRESULT … … 1675 1670 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 1676 1671 1677 infoPtr = (TRACKBAR_INFO *)COMCTL32_Alloc(sizeof(TRACKBAR_INFO)); 1678 SetWindowLongA(hwnd,0,(DWORD)infoPtr); 1672 infoPtr = (TRACKBAR_INFO*)initControl(hwnd,sizeof(TRACKBAR_INFO)); 1679 1673 1680 1674 /* set default values */ … … 1691 1685 infoPtr->tics = NULL; 1692 1686 infoPtr->clrBk = GetSysColor(COLOR_3DFACE); 1693 infoPtr->hwndNotify = GetParent(hwnd);1694 1687 1695 1688 infoPtr->hwndBuddyLA = 0; … … 1711 1704 if (dwStyle & TBS_TOOLTIPS) 1712 1705 { 1713 TTTOOLINFOA ti; 1714 1715 infoPtr->hwndToolTip = 1716 CreateWindowExA (WS_EX_TOOLWINDOW,TOOLTIPS_CLASSA,NULL,WS_POPUP, 1717 CW_USEDEFAULT,CW_USEDEFAULT, 1718 CW_USEDEFAULT,CW_USEDEFAULT, 1719 hwnd,0,0,0); 1720 1721 /* Send NM_TOOLTIPSCREATED notification */ 1722 if (infoPtr->hwndToolTip) 1723 { 1724 NMTOOLTIPSCREATED nmttc; 1725 1726 nmttc.hdr.hwndFrom = hwnd; 1727 nmttc.hdr.idFrom = GetWindowLongA(hwnd,GWL_ID); 1728 nmttc.hdr.code = NM_TOOLTIPSCREATED; 1729 nmttc.hwndToolTips = infoPtr->hwndToolTip; 1730 1731 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)nmttc.hdr.idFrom,(LPARAM)&nmttc); 1732 } 1733 1734 ZeroMemory(&ti,sizeof(TTTOOLINFOA)); 1735 ti.cbSize = sizeof(TTTOOLINFOA); 1736 ti.uFlags = TTF_TRACK | TTF_CENTERTIP | TTF_ABSOLUTE; 1737 ti.hwnd = hwnd; 1738 ti.uId = 0; 1739 ti.lpszText = ""; 1740 SetRectEmpty(&ti.rect); 1741 1742 SendMessageA(infoPtr->hwndToolTip,TTM_ADDTOOLA,0,(LPARAM)&ti); 1743 } else infoPtr->hwndToolTip = 0; 1706 UINT uFlags = TTF_TRACK | TTF_ABSOLUTE; 1707 1708 if (dwStyle & TBS_VERT) 1709 if (infoPtr->fLocation == TBTS_RIGHT) 1710 uFlags |= TTF_ALIGNRIGHT | TTF_VCENTER; 1711 else 1712 uFlags |= TTF_ALIGNLEFT | TTF_VCENTER; 1713 else 1714 if (infoPtr->fLocation == TBTS_TOP) 1715 uFlags |= TTF_ALIGNTOP | TTF_HCENTER; 1716 else 1717 uFlags |= TTF_ALIGNBOTTOM | TTF_HCENTER; 1718 1719 infoPtr->hwndToolTip = createToolTip(hwnd,uFlags); 1720 } 1744 1721 1745 1722 return 0; … … 1753 1730 1754 1731 /* delete tooltip control */ 1755 if (infoPtr->hwndToolTip) DestroyWindow(infoPtr->hwndToolTip);1732 destroyToolTip(infoPtr->hwndToolTip); 1756 1733 1757 1734 COMCTL32_Free(infoPtr->tics); 1758 COMCTL32_Free(infoPtr);1735 doneControl(hwnd); 1759 1736 1760 1737 return 0; … … 1767 1744 if (infoPtr->fLocation == TBTS_RIGHT) 1768 1745 { 1769 pt->x = infoPtr->rcFullThumb.right ;1746 pt->x = infoPtr->rcFullThumb.right+TOOLTIP_SPACE; 1770 1747 pt->y = infoPtr->rcFullThumb.top+(infoPtr->rcFullThumb.bottom-infoPtr->rcFullThumb.top)/2; 1771 1748 } else 1772 1749 { 1773 pt->x = infoPtr->rcFullThumb.left- 15; //CB: optimize!1750 pt->x = infoPtr->rcFullThumb.left-TOOLTIP_SPACE; 1774 1751 pt->y = infoPtr->rcFullThumb.top+(infoPtr->rcFullThumb.bottom-infoPtr->rcFullThumb.top)/2; 1775 1752 } … … 1780 1757 { 1781 1758 pt->x = infoPtr->rcFullThumb.left+(infoPtr->rcFullThumb.right-infoPtr->rcFullThumb.left)/2; 1782 pt->y = infoPtr->rcFullThumb.top- 15; //CB: optimize!1759 pt->y = infoPtr->rcFullThumb.top-TOOLTIP_SPACE; 1783 1760 } else 1784 1761 { 1785 1762 pt->x = infoPtr->rcFullThumb.left+(infoPtr->rcFullThumb.right-infoPtr->rcFullThumb.left)/2; 1786 pt->y = infoPtr->rcFullThumb.bottom ;1763 pt->y = infoPtr->rcFullThumb.bottom+TOOLTIP_SPACE; 1787 1764 } 1788 1765 } … … 1877 1854 char buf[80]; 1878 1855 1879 TRACKBAR_CalcToolTipPos(hwnd,dwStyle,infoPtr,&pt);1880 SendMessageA(infoPtr->hwndToolTip,TTM_TRACKPOSITION,0,(LPARAM)MAKELPARAM(pt.x,pt.y));1881 1882 1856 ti.cbSize = sizeof(TTTOOLINFOA); 1883 1857 ti.uId = 0; … … 1891 1865 1892 1866 SendMessageA(infoPtr->hwndToolTip,TTM_UPDATETIPTEXTA,0,(LPARAM)&ti); 1867 TRACKBAR_CalcToolTipPos(hwnd,dwStyle,infoPtr,&pt); 1868 SendMessageA(infoPtr->hwndToolTip,TTM_TRACKPOSITION,0,(LPARAM)MAKELPARAM(pt.x,pt.y)); 1869 1893 1870 SendMessageA(infoPtr->hwndToolTip,TTM_TRACKACTIVATE,(WPARAM)TRUE,(LPARAM)&ti); 1894 1871 } … … 1955 1932 if (GetCapture() == hwnd) 1956 1933 { 1957 NMHDR nmhdr; 1958 1959 nmhdr.hwndFrom = hwnd; 1960 nmhdr.idFrom = GetWindowLongA(hwnd,GWL_ID); 1961 nmhdr.code = NM_RELEASEDCAPTURE; 1962 1963 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 1934 sendNotify(hwnd,NM_RELEASEDCAPTURE); 1964 1935 1965 1936 ReleaseCapture(); … … 1975 1946 if (GetCapture() == hwnd) 1976 1947 { 1977 NMHDR nmhdr; 1978 1979 nmhdr.hwndFrom = hwnd; 1980 nmhdr.idFrom = GetWindowLongA(hwnd,GWL_ID); 1981 nmhdr.code = NM_RELEASEDCAPTURE; 1982 1983 SendMessageA(GetParent(hwnd),WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 1948 sendNotify(hwnd,NM_RELEASEDCAPTURE); 1984 1949 1985 1950 ReleaseCapture(); … … 2150 2115 2151 2116 2152 static BOOL 2153 TRACKBAR_SendNotify (HWND hwnd, UINT code) 2154 { 2155 // TRACE (trackbar, "%x\n",code); 2156 2157 if (GetWindowLongA(hwnd, GWL_STYLE) & TBS_VERT) 2158 { 2159 return (BOOL)SendMessageA(GetParent(hwnd),WM_VSCROLL,(WPARAM)code,(LPARAM)hwnd); 2160 } else 2161 { 2162 return (BOOL)SendMessageA(GetParent(hwnd),WM_HSCROLL,(WPARAM)code,(LPARAM)hwnd); 2163 } 2117 static BOOL TRACKBAR_SendNotify (HWND hwnd, UINT code) 2118 { 2119 if (GetWindowLongA(hwnd, GWL_STYLE) & TBS_VERT) 2120 return sendVScroll(hwnd,code); 2121 else 2122 return sendHScroll(hwnd,code); 2164 2123 } 2165 2124 … … 2172 2131 SHORT clickPlace; 2173 2132 DOUBLE dragPos; 2174 2175 // TRACE (trackbar, "%x\n",wParam);2176 2133 2177 2134 if (!(infoPtr->flags & TB_DRAG_MODE)) return TRUE; … … 2202 2159 ti.uId = 0; 2203 2160 ti.hinst = 0; 2204 sprintf 2161 sprintf(buf,"%d",infoPtr->nPos); 2205 2162 ti.lpszText = (LPSTR)buf; 2206 2163 … … 2373 2330 return TRACKBAR_GetToolTips (hwnd, wParam, lParam); 2374 2331 2375 case TBM_GETUNICODEFORMAT:2376 return TRACKBAR_GetUnicodeFormat(hwnd,wParam,lParam);2377 2378 2332 case TBM_SETBUDDY: 2379 2333 return TRACKBAR_SetBuddy (hwnd, wParam, lParam); … … 2479 2433 // ERR (trackbar, "unknown msg %04x wp=%08x lp=%08lx\n", 2480 2434 // uMsg, wParam, lParam); 2481 return DefWindowProcA (hwnd, uMsg, wParam, lParam);2435 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 2482 2436 } 2483 2437 return 0; … … 2489 2443 { 2490 2444 WNDCLASSA wndClass; 2491 2492 //SvL: Don't check this now2493 // if (GlobalFindAtomA (TRACKBAR_CLASSA)) return;2494 2445 2495 2446 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 2509 2460 TRACKBAR_Unregister (VOID) 2510 2461 { 2511 if (GlobalFindAtomA (TRACKBAR_CLASSA)) 2512 UnregisterClassA (TRACKBAR_CLASSA, (HINSTANCE)NULL); 2513 } 2514 2462 UnregisterClassA (TRACKBAR_CLASSA, (HINSTANCE)NULL); 2463 } 2464
Note:
See TracChangeset
for help on using the changeset viewer.