[ros-diffs] [gschneider] 46887: [DESK] - Don't autoequip listview item selections upon item creation - Handle selections via SetItemState, select newly added items that way - Fixes current background wallpaper item not being selected initially and selection being ignored later See issue #5030, 5116 for more details.

gschneider at svn.reactos.org gschneider at svn.reactos.org
Thu Apr 15 23:01:13 CEST 2010


Author: gschneider
Date: Thu Apr 15 23:01:12 2010
New Revision: 46887

URL: http://svn.reactos.org/svn/reactos?rev=46887&view=rev
Log:
[DESK]
- Don't autoequip listview item selections upon item creation
- Handle selections via SetItemState, select newly added items that way
- Fixes current background wallpaper item not being selected initially and selection being ignored later
See issue #5030,5116 for more details.

Modified:
    trunk/reactos/dll/cpl/desk/background.c

Modified: trunk/reactos/dll/cpl/desk/background.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?rev=46887&r1=46886&r2=46887&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Thu Apr 15 23:01:12 2010
@@ -94,14 +94,17 @@
 
     ZeroMemory(&listItem, sizeof(LV_ITEM));
     listItem.mask       = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
-    listItem.state      = LVIS_SELECTED;
+    listItem.state      = 0;
     listItem.pszText    = backgroundItem->szDisplayName;
     listItem.iImage     = -1;
     listItem.iItem      = pGlobalData->listViewItemCount;
     listItem.lParam     = pGlobalData->listViewItemCount;
 
     (void)ListView_InsertItem(hwndBackgroundList, &listItem);
-    ListView_SetItemState(hwndBackgroundList, pGlobalData->listViewItemCount, LVIS_SELECTED, LVIS_SELECTED);
+    ListView_SetItemState(hwndBackgroundList, 
+                          pGlobalData->listViewItemCount,
+                          LVIS_SELECTED,
+                          LVIS_SELECTED);
 
     pGlobalData->listViewItemCount++;
 
@@ -143,14 +146,17 @@
 
             ZeroMemory(&listItem, sizeof(LV_ITEM));
             listItem.mask       = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
-            listItem.state      = LVIS_SELECTED;
+            listItem.state      = 0;
             listItem.pszText    = backgroundItem->szDisplayName;
             listItem.iImage     = sfi.iIcon;
             listItem.iItem      = pGlobalData->listViewItemCount;
             listItem.lParam     = pGlobalData->listViewItemCount;
 
             (void)ListView_InsertItem(hwndBackgroundList, &listItem);
-            ListView_SetItemState(hwndBackgroundList, pGlobalData->listViewItemCount, LVIS_SELECTED, LVIS_SELECTED);
+            ListView_SetItemState(hwndBackgroundList,
+                                  pGlobalData->listViewItemCount,
+                                  LVIS_SELECTED,
+                                  LVIS_SELECTED);
 
             pGlobalData->listViewItemCount++;
         }
@@ -454,13 +460,17 @@
 
         ZeroMemory(&listItem, sizeof(LV_ITEM));
         listItem.mask       = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
-        listItem.state      = LVIS_SELECTED;
+        listItem.state      = 0;
         listItem.pszText    = backgroundItem->szDisplayName;
         listItem.iImage     = sfi.iIcon;
         listItem.iItem      = pGlobalData->listViewItemCount;
         listItem.lParam     = pGlobalData->listViewItemCount;
 
         (void)ListView_InsertItem(hwndBackgroundList, &listItem);
+        ListView_SetItemState(hwndBackgroundList,
+                              pGlobalData->listViewItemCount,
+                              LVIS_SELECTED,
+                              LVIS_SELECTED);
         SendMessage(hwndBackgroundList, WM_VSCROLL, SB_BOTTOM, 0);
 
         pGlobalData->listViewItemCount++;




More information about the Ros-diffs mailing list