listbox: ownerdraw fix

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

 



        Aric Stewart <aric@xxxxxxxxxxxxxxx>
	invalidate items on setselection for ownerdraw items        
-- 
Huw Davies
huw@xxxxxxxxxxxxxxx
Index: controls/listbox.c
===================================================================
RCS file: /home/wine/wine/controls/listbox.c,v
retrieving revision 1.97
diff -u -r1.97 listbox.c
--- controls/listbox.c	14 Oct 2003 05:24:21 -0000	1.97
+++ controls/listbox.c	17 Nov 2003 12:31:30 -0000
@@ -1143,6 +1143,13 @@
     }
 }
 
+static void LISTBOX_InvalidateItemRect( HWND hwnd, LB_DESCR *descr, INT index )
+{
+    RECT rect;
+
+    if (LISTBOX_GetItemRect( descr, index, &rect ) == 1)
+        InvalidateRect( hwnd, &rect, TRUE );
+}
 
 /***********************************************************************
  *           LISTBOX_GetItemHeight
@@ -1361,7 +1368,11 @@
         {
             if (descr->items[i].selected) continue;
             descr->items[i].selected = TRUE;
-            LISTBOX_RepaintItem( hwnd, descr, i, ODA_SELECT );
+            if (!IS_OWNERDRAW(descr))
+                LISTBOX_RepaintItem( hwnd, descr, i, ODA_SELECT );
+            else
+                LISTBOX_InvalidateItemRect(hwnd, descr, i);
+                
         }
         LISTBOX_SetCaretIndex( hwnd, descr, last, TRUE );
     }
@@ -1371,7 +1382,10 @@
         {
             if (!descr->items[i].selected) continue;
             descr->items[i].selected = FALSE;
-            LISTBOX_RepaintItem( hwnd, descr, i, ODA_SELECT );
+            if (!IS_OWNERDRAW(descr))
+                LISTBOX_RepaintItem( hwnd, descr, i, ODA_SELECT );
+            else
+                LISTBOX_InvalidateItemRect(hwnd, descr, i);
         }
     }
     return LB_OKAY;


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

  Powered by Linux