Listview scroll patch

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

 



* dlls/comctl32/listview.c:
Chris Morgan <cmorgan@alum.wpi.edu>
Listview should scroll by at least one column, fixes bug where item being
wider than listview prevents any scrolling from occuring.  Added printing
of the scroll code text during tracing of scroll functions.
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.334
diff -u -r1.334 listview.c
--- dlls/comctl32/listview.c	23 Dec 2002 02:02:06 -0000	1.334
+++ dlls/comctl32/listview.c	26 Dec 2002 20:10:21 -0000
@@ -362,6 +362,16 @@
   TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, debugrect(&iP->rcList)); \
 } while(0)
 
+/* Replace the scroll value with text */
+#define SCROLL_CODE_TEXT(nScrollCode) \
+	(nScrollCode == SB_LINELEFT) ? "SB_LINELEFT" : (nScrollCode == SB_LINERIGHT) \
+		? "SB_LINERIGHT" : (nScrollCode == SB_INTERNAL) ? "SB_INTERNAL" : \
+		(nScrollCode == SB_PAGELEFT) ? "SB_PAGELEFT" : (nScrollCode == \
+		SB_PAGERIGHT) ? "SB_PAGERIGHT" : (nScrollCode == SB_THUMBPOSITION) ? \
+		"SB_THUMBPOSITION" : (nScrollCode == SB_THUMBTRACK) ? \
+		"SB_THUMBTRACK" : \
+		(nScrollCode == SB_ENDSCROLL) ? "SB_ENDSCROLL" \
+		: "unknown"
 
 /*
  * forward declarations
@@ -1513,6 +1523,11 @@
     {
 	INT nPerCol = LISTVIEW_GetCountPerColumn(infoPtr);
 	horzInfo.nMax = (infoPtr->nItemCount + nPerCol - 1) / nPerCol;
+
+	/* scroll by at least one column per page */
+	if(horzInfo.nPage < infoPtr->nItemWidth)
+		horzInfo.nPage = infoPtr->nItemWidth;
+
 	horzInfo.nPage /= infoPtr->nItemWidth;
     }
     else if (uView == LVS_REPORT)
@@ -1543,6 +1558,11 @@
     if (uView == LVS_REPORT)
     {
 	vertInfo.nMax = infoPtr->nItemCount;
+	
+	/* scroll by at least one page */
+	if(vertInfo.nPage < infoPtr->nItemHeight)
+	  vertInfo.nPage = infoPtr->nItemHeight;
+
 	vertInfo.nPage /= infoPtr->nItemHeight;
     }
     else if (uView != LVS_LIST) /* LVS_ICON, or LVS_SMALLICON */
@@ -7144,7 +7164,8 @@
     SCROLLINFO scrollInfo;
     BOOL is_an_icon;
 
-    TRACE("(nScrollCode=%d, nScrollDiff=%d)\n", nScrollCode, nScrollDiff);
+    TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, 
+	SCROLL_CODE_TEXT(nScrollCode), nScrollDiff);
 
     if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
 
@@ -7247,7 +7268,8 @@
     INT nOldScrollPos, nNewScrollPos;
     SCROLLINFO scrollInfo;
 
-    TRACE("(nScrollCode=%d, nScrollDiff=%d)\n", nScrollCode, nScrollDiff);
+    TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, 
+	SCROLL_CODE_TEXT(nScrollCode), nScrollDiff);
 
     if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
 
@@ -7257,7 +7279,7 @@
     if (!GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) return 1;
 
     nOldScrollPos = scrollInfo.nPos;
-   
+
     switch (nScrollCode)
     {
     case SB_INTERNAL:

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

  Powered by Linux