Changeset 2221 for trunk/src/comctl32
- Timestamp:
- Dec 27, 1999, 11:54:49 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/trackbar.c
r1762 r2221 1 /* $Id: trackbar.c,v 1.2 3 1999-11-17 17:06:23cbratschi Exp $ */1 /* $Id: trackbar.c,v 1.24 1999-12-27 22:54:49 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 95 95 for (i = 0;i < infoPtr->uNumTics;i++) 96 96 { 97 if ( infoPtr->tics[i] >= infoPtr->nRangeMin && infoPtr->tics[i] <= infoPtr->nRangeMax)97 if ((infoPtr->tics[i] >= infoPtr->nRangeMin) && (infoPtr->tics[i] <= infoPtr->nRangeMax)) 98 98 { 99 99 oldTics[count] = infoPtr->tics[i]; … … 109 109 } 110 110 111 if (infoPtr->uTicFreq && infoPtr->nRangeMax > infoPtr->nRangeMin&& (dwStyle & TBS_AUTOTICKS))111 if (infoPtr->uTicFreq && (infoPtr->nRangeMax > infoPtr->nRangeMin) && (dwStyle & TBS_AUTOTICKS)) 112 112 { 113 113 //Tics without start and end tic … … 191 191 channel->bottom = lpRect.bottom-CHANNEL_SPACE; 192 192 193 if ( dwStyle & TBS_BOTH || dwStyle & TBS_NOTICKS)193 if ((dwStyle & TBS_BOTH) || (dwStyle & TBS_NOTICKS)) 194 194 { //center 195 195 channel->left = (lpRect.right-channelSize)/2; … … 208 208 channel->left = lpRect.left+CHANNEL_SPACE; 209 209 channel->right = lpRect.right-CHANNEL_SPACE; 210 if ( dwStyle & TBS_BOTH || dwStyle & TBS_NOTICKS)210 if ((dwStyle & TBS_BOTH) || (dwStyle & TBS_NOTICKS)) 211 211 { //center 212 212 channel->top = (lpRect.bottom-channelSize)/2; … … 281 281 range = infoPtr->nRangeMax-infoPtr->nRangeMin; 282 282 283 if ( range <= 0 || selMin == selMax) SetRectEmpty(selection);283 if ((range <= 0) || (selMin == selMax)) SetRectEmpty(selection); 284 284 else 285 285 if (!(GetWindowLongA(hwnd, GWL_STYLE) & TBS_VERT)) … … 494 494 RECT thumb = infoPtr->rcThumb; 495 495 496 if ( infoPtr->flags & TB_DRAG_MODE|| !IsWindowEnabled(hwnd)) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));496 if ((infoPtr->flags & TB_DRAG_MODE) || !IsWindowEnabled(hwnd)) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT)); 497 497 else hbr = CreateSolidBrush(GetSysColor(COLOR_3DFACE)); 498 498 hbrOld = SelectObject(hdc,hbr); … … 803 803 804 804 //check if maximum of visible marks is reached 805 if ( dwStyle & TBS_AUTOTICKS && infoPtr->uNumTics > 1 && (INT)(width*infoPtr->tics[0]/range) == (INT)(width*infoPtr->tics[1]/range))805 if ((dwStyle & TBS_AUTOTICKS) && (infoPtr->uNumTics > 1) && ((INT)(width*infoPtr->tics[0]/range) == (INT)(width*infoPtr->tics[1]/range))) 806 806 { 807 807 //draw all pixels at once -> much faster … … 902 902 infoPtr->flags &= ~TB_DRAGPOSVALID; 903 903 } 904 if (!mustRedraw && infoPtr->nPos == lastPos) return;904 if (!mustRedraw && (infoPtr->nPos == lastPos)) return; 905 905 906 906 if (dwStyle & TBS_NOTHUMB) return; … … 931 931 if (dwStyle & TBS_VERT) 932 932 { 933 if ( lastRect.top > newRect.top && lastRect.top < newRect.bottom)933 if ((lastRect.top > newRect.top) && (lastRect.top < newRect.bottom)) 934 934 BitBlt(hdc,newRect.left,newRect.top,newRect.right-newRect.left,lastRect.bottom-newRect.top,hdcCompatible,newRect.left,newRect.top,SRCCOPY); 935 else if ( lastRect.bottom < newRect.bottom && lastRect.bottom > newRect.top)935 else if ((lastRect.bottom < newRect.bottom) && (lastRect.bottom > newRect.top)) 936 936 BitBlt(hdc,lastRect.left,lastRect.top,lastRect.right-lastRect.left,newRect.bottom-lastRect.top,hdcCompatible,lastRect.left,lastRect.top,SRCCOPY); 937 937 else … … 942 942 } else 943 943 { 944 if ( lastRect.right > newRect.left && lastRect.right < newRect.right)944 if ((lastRect.right > newRect.left) && (lastRect.right < newRect.right)) 945 945 BitBlt(hdc,lastRect.left,lastRect.top,newRect.right-lastRect.left,lastRect.bottom-lastRect.top,hdcCompatible,lastRect.left,lastRect.top,SRCCOPY); 946 else if ( lastRect.left < newRect.right && lastRect.left > newRect.left)946 else if ((lastRect.left < newRect.right) && (lastRect.left > newRect.left)) 947 947 BitBlt(hdc,newRect.left,newRect.top,lastRect.right-newRect.left,newRect.bottom-newRect.top,hdcCompatible,newRect.left,newRect.top,SRCCOPY); 948 948 else … … 1327 1327 newMax = x; 1328 1328 } 1329 if ( newMin == infoPtr->nRangeMin && newMax == infoPtr->nRangeMax) return 0;1329 if ((newMin == infoPtr->nRangeMin) && (newMax == infoPtr->nRangeMax)) return 0; 1330 1330 1331 1331 infoPtr->nRangeMin = newMin; … … 1454 1454 newMax = (INT)HIWORD(lParam); 1455 1455 1456 if ( infoPtr->nSelMin == newMin && infoPtr->nSelMax == newMax) return 0;1456 if ((infoPtr->nSelMin == newMin) && (infoPtr->nSelMax == newMax)) return 0; 1457 1457 infoPtr->nSelMin = newMin; 1458 1458 infoPtr->nSelMax = newMax; … … 1467 1467 if (!GetWindowLongA(hwnd, GWL_STYLE) & TBS_ENABLESELRANGE) return 0; 1468 1468 1469 if ( oldMin != newMin || oldMax != newMax)1469 if ((oldMin != newMin) || (oldMax != newMax)) 1470 1470 { 1471 1471 infoPtr->flags |= TB_SELECTIONCHANGED; … … 1613 1613 if (dwStyle & TBS_VERT) 1614 1614 { 1615 if ( wParam == TBTS_LEFT || wParam == TBTS_RIGHT) infoPtr->fLocation = (INT)wParam;1615 if ((wParam == TBTS_LEFT) || (wParam == TBTS_RIGHT)) infoPtr->fLocation = (INT)wParam; 1616 1616 } else 1617 1617 { 1618 if ( wParam == TBTS_TOP || wParam == TBTS_BOTTOM) infoPtr->fLocation = (INT)wParam;1618 if ((wParam == TBTS_TOP) || (wParam == TBTS_BOTTOM)) infoPtr->fLocation = (INT)wParam; 1619 1619 } 1620 1620 … … 1815 1815 fullThumb = infoPtr->rcFullThumb; 1816 1816 if ((vertical && 1817 clickPoint.y >= thumb.top&&1818 clickPoint.y <= thumb.bottom&&1819 (( dwStyle & TBS_BOTH&&1820 clickPoint.x >= thumb.left&&1821 clickPoint.x <= thumb.right1817 (clickPoint.y >= thumb.top) && 1818 (clickPoint.y <= thumb.bottom) && 1819 (((dwStyle & TBS_BOTH) && 1820 (clickPoint.x >= thumb.left) && 1821 (clickPoint.x <= thumb.right) 1822 1822 ) || 1823 ( dwStyle & TBS_LEFT&&1824 clickPoint.x <= thumb.right&&1825 ( clickPoint.x >= thumb.left||1826 ( clickPoint.x >= fullThumb.left&&1827 ( thumb.left-clickPoint.x <= clickPoint.y-thumb.top&&1828 thumb.left-clickPoint.x <= thumb.bottom-clickPoint.y1823 ((dwStyle & TBS_LEFT) && 1824 (clickPoint.x <= thumb.right) && 1825 ((clickPoint.x >= thumb.left) || 1826 ((clickPoint.x >= fullThumb.left) && 1827 ((thumb.left-clickPoint.x <= clickPoint.y-thumb.top) && 1828 (thumb.left-clickPoint.x <= thumb.bottom-clickPoint.y) 1829 1829 ) 1830 1830 ) … … 1832 1832 ) || 1833 1833 (!(dwStyle & (TBS_BOTH | TBS_LEFT)) && 1834 clickPoint.x >= thumb.left&&1835 ( clickPoint.x <= thumb.right||1836 ( clickPoint.x <= fullThumb.right&&1837 ( clickPoint.x-thumb.right <= clickPoint.y-thumb.top&&1838 clickPoint.x-thumb.right <= thumb.bottom-clickPoint.y1834 (clickPoint.x >= thumb.left) && 1835 ((clickPoint.x <= thumb.right) || 1836 ((clickPoint.x <= fullThumb.right) && 1837 ((clickPoint.x-thumb.right <= clickPoint.y-thumb.top) && 1838 (clickPoint.x-thumb.right <= thumb.bottom-clickPoint.y) 1839 1839 ) 1840 1840 ) … … 1843 1843 ) || 1844 1844 (!vertical && 1845 clickPoint.x >= thumb.left&&1846 clickPoint.x <= thumb.right&&1847 (( dwStyle & TBS_BOTH&&1848 clickPoint.y >= thumb.top&&1849 clickPoint.y <= thumb.bottom1845 (clickPoint.x >= thumb.left) && 1846 (clickPoint.x <= thumb.right) && 1847 (((dwStyle & TBS_BOTH) && 1848 (clickPoint.y >= thumb.top) && 1849 (clickPoint.y <= thumb.bottom) 1850 1850 ) || 1851 ( dwStyle & TBS_TOP&&1852 clickPoint.y <= thumb.bottom&&1853 ( clickPoint.y >= thumb.top||1854 ( clickPoint.y >= fullThumb.top&&1855 ( thumb.top-clickPoint.y <= clickPoint.x-thumb.left&&1856 thumb.top-clickPoint.y <= thumb.right-clickPoint.x1851 ((dwStyle & TBS_TOP) && 1852 (clickPoint.y <= thumb.bottom) && 1853 ((clickPoint.y >= thumb.top) || 1854 ((clickPoint.y >= fullThumb.top) && 1855 ((thumb.top-clickPoint.y <= clickPoint.x-thumb.left) && 1856 (thumb.top-clickPoint.y <= thumb.right-clickPoint.x) 1857 1857 ) 1858 1858 ) … … 1860 1860 ) || 1861 1861 (!(dwStyle & (TBS_BOTH | TBS_TOP)) && 1862 clickPoint.y >= thumb.top&&1863 ( clickPoint.y <= thumb.bottom||1864 ( clickPoint.y <= fullThumb.bottom&&1865 ( clickPoint.y-thumb.bottom <= clickPoint.x-thumb.left&&1866 clickPoint.y-thumb.bottom <= thumb.right-clickPoint.x1862 (clickPoint.y >= thumb.top) && 1863 ((clickPoint.y <= thumb.bottom) || 1864 ((clickPoint.y <= fullThumb.bottom) && 1865 ((clickPoint.y-thumb.bottom <= clickPoint.x-thumb.left) && 1866 (clickPoint.y-thumb.bottom <= thumb.right-clickPoint.x) 1867 1867 ) 1868 1868 )
Note:
See TracChangeset
for help on using the changeset viewer.