Changeset 942 for trunk/src/comctl32/trackbar.c
- Timestamp:
- Sep 15, 1999, 6:31:49 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/trackbar.c
r912 r942 1 /* $Id: trackbar.c,v 1.1 7 1999-09-12 16:52:46cbratschi Exp $ */1 /* $Id: trackbar.c,v 1.18 1999-09-15 16:31:48 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 9 9 * 10 10 * 11 * Status: ready to use11 * Status: complete 12 12 * Version: 5.00 13 * 14 * Note: TBM_SETTHUMBLENGTH implemented, COMCTL32 5.00 ignores it 13 15 */ 14 16 … … 484 486 //draw thumb, call only from draw! 485 487 486 static VOID TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr,H DC hdc,DWORD dwStyle)488 static VOID TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr,HWND hwnd,HDC hdc,DWORD dwStyle) 487 489 { 488 490 if (!(dwStyle & TBS_NOTHUMB)) … … 491 493 RECT thumb = infoPtr->rcThumb; 492 494 493 if (infoPtr->flags & TB_DRAG_MODE ) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));495 if (infoPtr->flags & TB_DRAG_MODE || !IsWindowEnabled(hwnd)) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT)); 494 496 else hbr = CreateSolidBrush(GetSysColor(COLOR_3DFACE)); 495 497 hbrOld = SelectObject(hdc,hbr); … … 730 732 if (infoPtr->flags & TB_THUMBCHANGED) 731 733 { 732 if (infoPtr->flags & TB_THUMBSIZECHANGED) TRACKBAR_CalcChannel(hwnd,infoPtr); 734 if (infoPtr->flags & TB_THUMBSIZECHANGED) 735 { 736 TRACKBAR_CalcChannel(hwnd,infoPtr); 737 TRACKBAR_CalcSelection(hwnd,infoPtr); 738 } 733 739 TRACKBAR_CalcThumb(hwnd,infoPtr); 734 740 } … … 851 857 if (!(cdres & CDRF_SKIPDEFAULT)) 852 858 { 853 TRACKBAR_DrawThumb(infoPtr,h dc,dwStyle);859 TRACKBAR_DrawThumb(infoPtr,hwnd,hdc,dwStyle); 854 860 855 861 if (cdctlres & CDRF_NOTIFYITEMDRAW) … … 862 868 } 863 869 864 if (infoPtr->bFocus ) DrawFocusRect(hdc,&rcClient);870 if (infoPtr->bFocus && IsWindowEnabled(hwnd)) DrawFocusRect(hdc,&rcClient); 865 871 866 872 if (cdctlres & CDRF_NOTIFYPOSTPAINT) … … 1222 1228 1223 1229 1224 /* case TBM_GETUNICODEFORMAT: */ 1225 1230 static 1231 TRACKBAR_GetUnicodeFormat(HWND hwnd,WPARAM wParam,LPARAM lParam) 1232 { 1233 return FALSE; //Unicode not used 1234 } 1226 1235 1227 1236 static LRESULT … … 1622 1631 return 0; 1623 1632 } 1624 1625 1626 /* case TBM_SETUNICODEFORMAT: */1627 1628 1633 1629 1634 static LRESULT … … 2044 2049 2045 2050 static LRESULT 2051 TRACKBAR_SetUnicodeFormat(HWND hwnd,WPARAM wParam,LPARAM lParam) 2052 { 2053 //wParam = new format 2054 2055 return FALSE; //previous was no Unicode 2056 } 2057 2058 static LRESULT 2046 2059 TRACKBAR_CaptureChanged (HWND hwnd, WPARAM wParam, LPARAM lParam) 2047 2060 { … … 2089 2102 2090 2103 // TRACE (trackbar,"\n"); 2091 if (!infoPtr->bFocus )2104 if (!infoPtr->bFocus && IsWindowEnabled(hwnd)) 2092 2105 { 2093 2106 infoPtr->bFocus = TRUE; … … 2112 2125 2113 2126 infoPtr->flags &= ~TB_DRAG_MODE; 2114 if (infoPtr->bFocus )2127 if (infoPtr->bFocus && IsWindowEnabled(hwnd)) 2115 2128 { 2116 2129 infoPtr->bFocus = FALSE; … … 2200 2213 } 2201 2214 2215 static LRESULT 2216 TRACKBAR_Enable(HWND hwnd,WPARAM wParam,LPARAM lParam) 2217 { 2218 TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(hwnd); 2219 2220 if (wParam) infoPtr->bFocus = (GetFocus() == hwnd); 2221 else infoPtr->bFocus = FALSE; 2222 2223 TRACKBAR_Refresh(hwnd); 2224 2225 return 0; 2226 } 2202 2227 2203 2228 static LRESULT … … 2346 2371 return TRACKBAR_GetToolTips (hwnd, wParam, lParam); 2347 2372 2348 /* case TBM_GETUNICODEFORMAT: */ 2373 case TBM_GETUNICODEFORMAT: 2374 return TRACKBAR_GetUnicodeFormat(hwnd,wParam,lParam); 2349 2375 2350 2376 case TBM_SETBUDDY: … … 2393 2419 return TRACKBAR_SetToolTips (hwnd, wParam, lParam); 2394 2420 2395 /* case TBM_SETUNICODEFORMAT: */ 2396 2421 case TBM_SETUNICODEFORMAT: 2422 return TRACKBAR_SetUnicodeFormat(hwnd,wParam,lParam); 2397 2423 2398 2424 case WM_CAPTURECHANGED: … … 2405 2431 return TRACKBAR_Destroy (hwnd, wParam, lParam); 2406 2432 2407 /* case WM_ENABLE: */ 2408 2409 /* case WM_ERASEBKGND: */ 2410 /* return 0; */ 2433 case WM_ENABLE: 2434 return TRACKBAR_Enable(hwnd,wParam,lParam); 2435 2436 case WM_ERASEBKGND: 2437 return 1; 2411 2438 2412 2439 case WM_GETDLGCODE:
Note:
See TracChangeset
for help on using the changeset viewer.