- Timestamp:
- Sep 15, 1999, 6:31:49 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 2 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: -
trunk/src/comctl32/updown.c
r496 r942 1 /* $Id: updown.c,v 1. 7 1999-08-14 16:13:16cbratschi Exp $ */1 /* $Id: updown.c,v 1.8 1999-09-15 16:31:49 cbratschi Exp $ */ 2 2 /* 3 3 * Updown control … … 18 18 * - listbox as buddy window 19 19 * - acceleration 20 * - base 16 20 * - base 16 -> bug: 9->B (should be A) 21 21 * - UDS_ALIGNLEFT, ~UDS_WRAP 22 22 * (tested - they work) … … 133 133 134 134 return ( ((dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) && 135 136 135 (SendMessageA(hwnd, UDM_GETBUDDY, 0, 0) != 0) && 136 (lstrcmpiA(infoPtr->szBuddyClass, "EDIT") == 0 ) ); 137 137 } 138 138 … … 209 209 * Returns the thousand sep. If an error occurs, it returns ','. 210 210 */ 211 static char UPDOWN_GetThousandSep( )211 static char UPDOWN_GetThousandSep(VOID) 212 212 { 213 213 char sep[2]; … … 430 430 RECT budRect; /* new coord for the buddy */ 431 431 int x,width; /* new x position and width for the up-down */ 432 432 433 433 /* Is it a valid bud? */ 434 434 if(!IsWindow(hwndBud)) … … 476 476 GetWindowRect(infoPtr->Buddy, &budRect); 477 477 MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Buddy), 478 478 (POINT *)(&budRect.left), 2); 479 479 480 480 /* now do the positioning */ … … 490 490 /* first adjust the buddy to accomodate the up/down */ 491 491 SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top, 492 493 492 budRect.right - budRect.left, budRect.bottom - budRect.top, 493 SWP_NOACTIVATE|SWP_NOZORDER); 494 494 495 495 /* now position the up/down */ … … 512 512 513 513 SetWindowPos (hwnd, infoPtr->Buddy, 514 515 516 514 x, budRect.top-DEFAULT_ADDTOP, 515 width, (budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT, 516 SWP_NOACTIVATE); 517 517 518 518 return TRUE; 519 } 519 } 520 520 521 521 /*********************************************************************** … … 1133 1133 else 1134 1134 { 1135 1135 UPDOWN_GetBuddyInt(upDownHwnd); 1136 1136 UPDOWN_DoAction(upDownHwnd, 1, wParam==VK_UP); 1137 1137 }
Note:
See TracChangeset
for help on using the changeset viewer.