Changeset 373 for trunk/src/helpers/winh.c
- Timestamp:
- Nov 16, 2008, 11:36:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/winh.c
r346 r373 19 19 20 20 /* 21 * Copyright (C) 1997-200 6Ulrich Mller.21 * Copyright (C) 1997-2008 Ulrich Mller. 22 22 * This file is part of the "XWorkplace helpers" source package. 23 23 * This is free software; you can redistribute it and/or modify … … 1935 1935 * the workarea minus one. 1936 1936 * 1937 * [pr]: I disagree with the above "workarea minus one" stuff. 1938 * It is perfectly possible to have the workarea and the 1939 * window area the same size and to display all the content. 1940 * This also means you do NOT get a disabled scroll bar 1941 * any more when they are the same size. 1942 * 1937 1943 * For horizontal scroll bars, this is the X coordinate, 1938 1944 * counting from the left of the window (0 means leftmost). … … 1970 1976 *@@changed V1.0.1 (2003-01-25) [umoeller]: fixed max value which caused right/bottommost scroll button to never be disabled 1971 1977 *@@changed V1.0.1 (2003-01-25) [umoeller]: fixed bad thumb position for large offsets 1978 *@@changed WarpIN V1.0.18 (2008-11-16) [pr]: fix rounding errors @@fixes 1086 1979 *@@changed WarpIN V1.0.18 (2008-11-16) [pr]: disable scroll bars when workarea = win area @@fixes 1086 1972 1980 */ 1973 1981 … … 1987 1995 BOOL brc = FALSE; 1988 1996 1989 if (ulWorkareaPels > = ulWinPels)1997 if (ulWorkareaPels > ulWinPels) // WarpIN V1.0.18 1990 1998 { 1991 1999 // for large workareas, adjust scroll bar units 1992 USHORT usDivisor = 1 ;2000 USHORT usDivisor = 1, usRounder; 1993 2001 USHORT lMaxAllowedUnitOfs; 1994 2002 … … 1996 2004 usDivisor = 100; 1997 2005 2006 usRounder = usDivisor - 1; // WarpIN V1.0.18 1998 2007 // scrollbar needed: 1999 2008 … … 2004 2013 2005 2014 // calculate limit 2006 lMaxAllowedUnitOfs = (ulWorkareaPels - ulWinPels )2015 lMaxAllowedUnitOfs = (ulWorkareaPels - ulWinPels + usRounder) 2007 2016 / usDivisor; 2008 2017 … … 2010 2019 WinSendMsg(hwndScrollBar, 2011 2020 SBM_SETSCROLLBAR, 2012 (MPARAM)( ulCurPelsOfs/ usDivisor), // position: 0 means top2021 (MPARAM)((ulCurPelsOfs + usRounder) / usDivisor), // position: 0 means top 2013 2022 MPFROM2SHORT(0, // minimum 2014 2023 lMaxAllowedUnitOfs)); // maximum … … 2018 2027 WinSendMsg(hwndScrollBar, 2019 2028 SBM_SETTHUMBSIZE, 2020 MPFROM2SHORT( ulWinPels/ usDivisor, // visible2021 ulWorkareaPels/ usDivisor), // total2029 MPFROM2SHORT( (ulWinPels + usRounder) / usDivisor, // visible 2030 (ulWorkareaPels + usRounder) / usDivisor), // total 2022 2031 0); 2023 2032 brc = TRUE; … … 2077 2086 *@@changed V0.9.7 (2001-01-17) [umoeller]: changed PLONG to PULONG 2078 2087 *@@changed V1.0.1 (2003-01-25) [umoeller]: changed prototype, no longer calling WinScrollWindow, fixed offset bugs 2088 *@@changed WarpIN V1.0.18 (2008-11-16) [pr]: fix rounding error @@fixes 1086 2079 2089 */ 2080 2090 … … 2147 2157 WinSendMsg(hwndScrollBar, 2148 2158 SBM_SETPOS, 2149 (MPARAM)( *plCurPelsOfs / lScrollUnitPels),2159 (MPARAM)((*plCurPelsOfs + (lScrollUnitPels / 2)) / lScrollUnitPels), // WarpIN V1.0.18 2150 2160 0); 2151 2161
Note:
See TracChangeset
for help on using the changeset viewer.