scrollbar: positioning and SB_THUMBPOSITION tracking
Jake Hamby
jhamby at anobject.com
Fri May 7 16:49:43 CDT 2004
* controls/scroll.c
Jake Hamby <jhamby at anobject.com>
This patch addresses two issues in scrollbar handling. First, if the
window has WS_BORDER set (as most of them do), the scrollbars are sized
one pixel larger in each direction, which pushes them into the border of
the window and messes up the 3-D look. On Windows, scrollbars are
contained within the window and are not pushed into the border. So I've
removed that code, keeping the code that adjusts the right/bottom border
by one pixel when both scrollbars are active.
The second problem is demonstrated by the SysMets3 example from Petzold
Chapter 4. It uses SB_THUMBTRACK messages to update the vertical
scrollbar, and SB_THUMBPOSITION for the horizontal scrollbar (to
demonstrate both ways of handling updates). The problem is that by the
time the application's WndProc handler receives the SB_THUMBPOSITION
message, the scrollbar event handler has already reset
SCROLL_TrackingWin to 0, so that when the app calls GetScrollInfo() to
retrieve the last tracking position, it fills info->nTrackPos with the
old value, so the result is that the slider "pops" to the old value when
you release the mouse button. I've patched this by adding a second
variable, SCROLL_TrackingWinPrev, so that GetScrollInfo() returns the
value from SCROLL_TrackingVal in this case.
-Jake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch3.diff
Type: text/x-patch
Size: 2810 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20040507/7594515c/patch3.bin
More information about the wine-patches
mailing list