Resubmit with function instead of macro ;-) On Thursday 26 December 2002 04:06 pm, Chris Morgan wrote: > * 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 27 Dec 2002 05:21:15 -0000 @@ -362,7 +362,6 @@ TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, debugrect(&iP->rcList)); \ } while(0) - /* * forward declarations */ @@ -674,7 +673,6 @@ return text; } - static char* debuglvhittestinfo(const LVHITTESTINFO *lpht) { if (lpht) @@ -686,6 +684,24 @@ } else return "(null)"; } +/* Return the corresponding text for a given scroll value */ +static inline LPSTR debugscrollcode(int nScrollCode) +{ + switch(nScrollCode) + { + case SB_LINELEFT: return "SB_LINELEFT"; + case SB_LINERIGHT: return "SB_LINERIGHT"; + case SB_PAGELEFT: return "SB_PAGELEFT"; + case SB_PAGERIGHT: return "SB_PAGERIGHT"; + case SB_THUMBPOSITION: return "SB_THUMBPOSITION"; + case SB_THUMBTRACK: return "SB_THUMBTRACK"; + case SB_ENDSCROLL: return "SB_ENDSCROLL"; + case SB_INTERNAL: return "SB_INTERNAL"; + default: return "unknown"; + } +} + + /******** Notification functions i************************************/ static LRESULT notify_hdr(LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh) @@ -1513,6 +1529,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 +1564,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 +7170,8 @@ SCROLLINFO scrollInfo; BOOL is_an_icon; - TRACE("(nScrollCode=%d, nScrollDiff=%d)\n", nScrollCode, nScrollDiff); + TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, + debugscrollcode(nScrollCode), nScrollDiff); if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); @@ -7247,7 +7274,8 @@ INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; - TRACE("(nScrollCode=%d, nScrollDiff=%d)\n", nScrollCode, nScrollDiff); + TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, + debugscrollcode(nScrollCode), nScrollDiff); if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); @@ -7257,7 +7285,7 @@ if (!GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) return 1; nOldScrollPos = scrollInfo.nPos; - + switch (nScrollCode) { case SB_INTERNAL: