winhelp scrolling
Johan Dahlin
jdahlin at async.com.br
Sat Aug 9 18:05:10 CDT 2003
ChangeLog:
Johan Dahlin <jdahlin at async.com.br>
Make sure winhelp doesn't scroll outside of it's display area.
Index: programs/winhelp/winhelp.c
===================================================================
RCS file: /home/wine/wine/programs/winhelp/winhelp.c,v
retrieving revision 1.26
diff -u -r1.26 winhelp.c
--- programs/winhelp/winhelp.c 4 Jun 2003 20:13:54 -0000 1.26
+++ programs/winhelp/winhelp.c 9 Aug 2003 23:03:51 -0000
@@ -814,6 +814,8 @@
RECT rect;
INT Min, Max;
INT CurPos = GetScrollPos(hWnd, SB_VERT);
+ INT dy;
+
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
GetClientRect(hWnd, &rect);
@@ -831,7 +833,11 @@
}
if (update)
{
- INT dy = GetScrollPos(hWnd, SB_VERT) - CurPos;
+ if (CurPos > Max)
+ CurPos = Max;
+ else if (CurPos < Min)
+ CurPos = Min;
+ dy = GetScrollPos(hWnd, SB_VERT) - CurPos;
SetScrollPos(hWnd, SB_VERT, CurPos, TRUE);
ScrollWindow(hWnd, 0, dy, NULL, NULL);
UpdateWindow(hWnd);
--
Johan Dahlin <jdahlin at async.com.br>
Async Open Source
More information about the wine-patches
mailing list