winhelp scrolling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog:
    Johan Dahlin <jdahlin@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@async.com.br>
Async Open Source



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux