Aric Stewart : comctl32: Add implementation of LVS_EX_ONECLICKACTIVATE.

Alexandre Julliard julliard at winehq.org
Wed Nov 5 09:37:49 CST 2008


Module: wine
Branch: master
Commit: e46a87599660f2bc92676df3dba6b27eb24bf8b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e46a87599660f2bc92676df3dba6b27eb24bf8b0

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Nov  4 12:11:57 2008 -0600

comctl32: Add implementation of LVS_EX_ONECLICKACTIVATE.

---

 dlls/comctl32/listview.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 47d79d6..ce1e1b4 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -95,10 +95,8 @@
  *   -- LVS_EX_INFOTIP
  *   -- LVS_EX_LABELTIP
  *   -- LVS_EX_MULTIWORKAREAS
- *   -- LVS_EX_ONECLICKACTIVATE
  *   -- LVS_EX_REGIONAL
  *   -- LVS_EX_SIMPLESELECT
- *   -- LVS_EX_TRACKSELECT
  *   -- LVS_EX_TWOCLICKACTIVATE
  *   -- LVS_EX_UNDERLINECOLD
  *   -- LVS_EX_UNDERLINEHOT
@@ -3270,6 +3268,13 @@ static BOOL LISTVIEW_GetItemAtPt(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVIte
     return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
 }
 
+static inline BOOL LISTVIEW_isHotTracking(const LISTVIEW_INFO *infoPtr)
+{
+    return ((infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) ||
+            (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE) ||
+            (infoPtr->dwLvExStyle & LVS_EX_TWOCLICKACTIVATE));
+}
+
 /***
  * DESCRIPTION:
  * Called when the mouse is being actively tracked and has hovered for a specified
@@ -3290,7 +3295,7 @@ static BOOL LISTVIEW_GetItemAtPt(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVIte
  */
 static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
 {
-    if (infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)
+    if (LISTVIEW_isHotTracking(infoPtr))
     {
         LVITEMW item;
         POINT pt;
@@ -3364,7 +3369,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
         infoPtr->bLButtonDown = FALSE;
 
     /* see if we are supposed to be tracking mouse hovering */
-    if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) {
+    if (LISTVIEW_isHotTracking(infoPtr)) {
         /* fill in the trackinfo struct */
         trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
         trackinfo.dwFlags = TME_QUERY;
@@ -8694,6 +8699,9 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
         LISTVIEW_SetSelection(infoPtr, nItem);
       }
     }
+
+    if (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE)
+        if(lvHitTestInfo.iItem != -1) notify_itemactivate(infoPtr,&lvHitTestInfo);
   }
   else
   {
@@ -9235,7 +9243,7 @@ static BOOL LISTVIEW_SetCursor(const LISTVIEW_INFO *infoPtr, HWND hwnd, UINT nHi
 {
     LVHITTESTINFO lvHitTestInfo;
 
-    if(!(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)) return FALSE;
+    if(!(LISTVIEW_isHotTracking(infoPtr))) return FALSE;
 
     if(!infoPtr->hHotCursor)  return FALSE;
 




More information about the wine-cvs mailing list