Listview - issue CCSelect sound

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

 



This patch depends on the "Add Support for CCSelect sound" patch.

License: X11

Changelog:
Guy Albertelli  <<galberte@neo.lrun.com>>

  dlls/comctl32/listview.c
    - Play the CCSelect sound on LButtonDown.
    - Document other calls that are not done in LButtonDown
      compared to native.
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.156
diff -u -r1.156 listview.c
--- dlls/comctl32/listview.c	29 Sep 2002 18:34:51 -0000	1.156
+++ dlls/comctl32/listview.c	30 Sep 2002 04:06:18 -0000
@@ -8308,52 +8308,77 @@
   nItem = LISTVIEW_GetItemAtPt(infoPtr, pt);
   if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)))
   {
-    if (lStyle & LVS_SINGLESEL)
-    {
-      if ((LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) & LVIS_SELECTED)
-          && infoPtr->nEditLabelItem == -1)
-          infoPtr->nEditLabelItem = nItem;
-      else
-        LISTVIEW_SetSelection(infoPtr, nItem);
-    }
-    else
-    {
-      if ((wKey & MK_CONTROL) && (wKey & MK_SHIFT))
-      {
-        if (bGroupSelect)
-          LISTVIEW_AddGroupSelection(infoPtr, nItem);
-        else
-          LISTVIEW_AddSelection(infoPtr, nItem);
-      }
-      else if (wKey & MK_CONTROL)
-      {
-        LVITEMW item;
+      /* Play the "Common Control Selected" sound */
+      COMCTL32_PlayCCSelectSound();
 
-	bGroupSelect = (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) == 0);
-	
-	item.state = bGroupSelect ? LVIS_SELECTED : 0;
-        item.stateMask = LVIS_SELECTED;
-	LISTVIEW_SetItemState(infoPtr, nItem, &item);
+      /* FIXME?? native does:
+       *  GetDoubleClickTime()
+       *  SetTimer(hwnd, 2b, time, 0)
+       */
 
-        LISTVIEW_SetItemFocus(infoPtr, nItem);
-        infoPtr->nSelectionMark = nItem;
-      }
-      else  if (wKey & MK_SHIFT)
+      if (lStyle & LVS_SINGLESEL)
       {
-        LISTVIEW_SetGroupSelection(infoPtr, nItem);
+	  if ((LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) & LVIS_SELECTED)
+	      && infoPtr->nEditLabelItem == -1)
+	      infoPtr->nEditLabelItem = nItem;
+	  else
+	      LISTVIEW_SetSelection(infoPtr, nItem);
       }
       else
       {
-	BOOL was_selected =
-	    (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) & LVIS_SELECTED);
+	  if ((wKey & MK_CONTROL) && (wKey & MK_SHIFT))
+	  {
+	      if (bGroupSelect)
+		  LISTVIEW_AddGroupSelection(infoPtr, nItem);
+	      else
+		  LISTVIEW_AddSelection(infoPtr, nItem);
+	  }
+	  else if (wKey & MK_CONTROL)
+	  {
+	      LVITEMW item;
+
+	      bGroupSelect = (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) == 0);
+	
+	      item.state = bGroupSelect ? LVIS_SELECTED : 0;
+	      item.stateMask = LVIS_SELECTED;
+	      LISTVIEW_SetItemState(infoPtr, nItem, &item);
+
+	      LISTVIEW_SetItemFocus(infoPtr, nItem);
+	      infoPtr->nSelectionMark = nItem;
+	  }
+	  else  if (wKey & MK_SHIFT)
+	  {
+	      LISTVIEW_SetGroupSelection(infoPtr, nItem);
+	  }
+	  else
+	  {
+	      BOOL was_selected =
+		  (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) & LVIS_SELECTED);
 
-	/* set selection (clears other pre-existing selections) */
-        LISTVIEW_SetSelection(infoPtr, nItem);
+	      /* set selection (clears other pre-existing selections) */
+	      LISTVIEW_SetSelection(infoPtr, nItem);
 
-        if (was_selected && infoPtr->nEditLabelItem == -1)
-          infoPtr->nEditLabelItem = nItem;
+	      if (was_selected && infoPtr->nEditLabelItem == -1)
+		  infoPtr->nEditLabelItem = nItem;
+	  }
       }
-    }
+      /* FIXME?? native does:
+       *  GetFocus()
+       *  NotifyWinEvent(0008005, hwnd, -4, 7)
+       *  NotifyWinEvent(0008006, hwnd, -4, 7)
+       *  GetSystemMetrics(0x44 SM_CXDRAG)
+       *  GetSystemMetrics(0x45 SM_CYDRAG)
+       *  SetRect(&a, 0x1f5, 0x20, 0x1fd, 0x28)
+       *  MapWindowPoints(hwnd, 0, &a, 2)
+       *  SetCapture(hwnd)
+       *  PeekMessage(???, 0, 0, 0, 1)
+       *  CallMsgFilterA(???, 0x00004200)
+       *  ReleaseCapture()
+       *  IsWindow(hwnd)
+       *  SetFocus(hwnd)
+       *  notify NM_CLICK
+       *  return DefWindowProcA()
+       */
   }
   else
   {

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

  Powered by Linux