Re: Fix ListView Bugs

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

 



I think that patch is not correct because it does not correctly handle
the subitem customdraw notification. Dimitrie O. Paun and I are working
on a patch to solve that. 

Robert can you try the attached patch to see if it solves the point 1.
in your case ?
If it doesn't I think we should make a merge of our patches.

Max

On Fri, 2003-05-16 at 13:02, Robert Shearman wrote:
> Fixes two bugs.
> 1. Regression. The colour used for the background of text that wasn't
> selected wasn't being set properly any more, as it had been moved into
> notify_prepaint. This patch moves it back to where it was before and the
> text background appears correctly.
> 2. Don't clear the item header when column 0 is inserted - it would clear
> anything already set in the header, such as information set by InsertItem
> 
> ChangeLog:
> - Make selected text appear correctly now
> - Don't clear header for subitem 0 when column 0 is inserted
> 
> Rob
-- 
Maxime Bellengà <maxime.bellenge@laposte.net>
Index: wine/dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.351
diff -u -r1.351 listview.c
--- wine/dlls/comctl32/listview.c	13 May 2003 00:30:10 -0000	1.351
+++ wine/dlls/comctl32/listview.c	15 May 2003 20:10:10 -0000
@@ -272,6 +272,8 @@
   DWORD dwHoverTime;
   HWND hwndToolTip;
 
+  DWORD cditemmode;             /* Keep the custom draw flags for an item/row */
+
   DWORD lastKeyPressTimestamp;
   WPARAM charCode;
   INT nSearchParamLength;
@@ -3526,7 +3528,7 @@
     UINT uFormat, uView = infoPtr->dwStyle & LVS_TYPEMASK;
     WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
     WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 };
-    DWORD cditemmode = CDRF_DODEFAULT;
+    DWORD cdsubitemmode = CDRF_DODEFAULT;
     RECT* lprcFocus, rcSelect, rcBox, rcState, rcIcon, rcLabel;
     NMLVCUSTOMDRAW nmlvcd;
     HIMAGELIST himl;
@@ -3565,14 +3567,21 @@
 
     /* fill in the custom draw structure */
     customdraw_fill(&nmlvcd, infoPtr, hdc, &rcBox, &lvItem);
+    if (nSubItem == 0) {      
+      if (cdmode & CDRF_NOTIFYITEMDRAW) 
+	infoPtr->cditemmode = notify_prepaint (infoPtr, hdc, &nmlvcd);
 
-    if (cdmode & CDRF_NOTIFYITEMDRAW)
-        cditemmode = notify_prepaint (infoPtr, hdc, &nmlvcd);
-    if (cditemmode & CDRF_SKIPDEFAULT) goto postpaint;
+      if (infoPtr->cditemmode & CDRF_SKIPDEFAULT) goto postpaint;
+    } else {
+      if (infoPtr->cditemmode & CDRF_NOTIFYSUBITEMDRAW) {
+	cdsubitemmode = notify_prepaint (infoPtr, hdc, &nmlvcd);
+	if (cdsubitemmode  & CDRF_SKIPDEFAULT) goto postpaint;
+      }
+    }
 
     /* in full row select, subitems, will just use main item's colors */
     if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
	nmlvcd.clrTextBk = CLR_NONE;
     
     /* state icons */
     if (infoPtr->himlState && !IsRectEmpty(&rcState))
@@ -3631,8 +3640,9 @@
     DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);
 
 postpaint:
-    if (cditemmode & CDRF_NOTIFYPOSTPAINT)
-        notify_postpaint(infoPtr, &nmlvcd);
+    if ( ((nSubItem > 0) && (cdsubitemmode & CDRF_NOTIFYPOSTPAINT)) ||   
+	 ((nSubItem == 0) && (infoPtr->cditemmode & CDRF_NOTIFYPOSTPAINT)) )
+      notify_postpaint(infoPtr, &nmlvcd);
     return TRUE;
 }
 
@@ -3841,6 +3851,8 @@
     oldClrTextBk = infoPtr->clrTextBk;
     oldClrText   = infoPtr->clrText;
    
+    infoPtr->cditemmode = CDRF_DODEFAULT;
+
     GetClientRect(infoPtr->hwndSelf, &rcClient);
     customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0);
     cdmode = notify_prepaint(infoPtr, hdc, &nmlvcd);

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

  Powered by Linux