Nikolay Sivov : comctl32/header: Implement HDM_SETFILTERCHANGETIMEOUT.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 18 10:51:12 CDT 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue May 17 23:42:52 2016 +0300

comctl32/header: Implement HDM_SETFILTERCHANGETIMEOUT.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/header.c       | 13 ++++++++++++-
 dlls/comctl32/tests/header.c | 13 ++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index fb6a815..edfe385 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -84,6 +84,7 @@ typedef struct
     INT       iHotItem;		/* index of hot item (cursor is over this item) */
     INT       iHotDivider;      /* index of the hot divider (used while dragging an item or by HDM_SETHOTDIVIDER) */
     INT       iMargin;          /* width of the margin that surrounds a bitmap */
+    INT       filter_change_timeout; /* change timeout set with HDM_SETFILTERCHANGETIMEOUT */
 
     HIMAGELIST  himl;		/* handle to an image list (may be 0) */
     HEADER_ITEM *items;		/* pointer to array of HEADER_ITEM's */
@@ -1540,6 +1541,7 @@ HEADER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
     infoPtr->iMargin = 3*GetSystemMetrics(SM_CXEDGE);
     infoPtr->nNotifyFormat =
 	SendMessageW (infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
+    infoPtr->filter_change_timeout = 1000;
 
     hdc = GetDC (0);
     hOldFont = SelectObject (hdc, GetStockObject (SYSTEM_FONT));
@@ -2054,6 +2056,14 @@ static LRESULT HEADER_ThemeChanged(const HEADER_INFO *infoPtr)
     return 0;
 }
 
+static INT HEADER_SetFilterChangeTimeout(HEADER_INFO *infoPtr, INT timeout)
+{
+    INT old_timeout = infoPtr->filter_change_timeout;
+
+    if (timeout != 0)
+        infoPtr->filter_change_timeout = timeout;
+    return old_timeout;
+}
 
 static LRESULT WINAPI
 HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -2112,7 +2122,8 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 	case HDM_SETBITMAPMARGIN:
 	    return HEADER_SetBitmapMargin(infoPtr, (INT)wParam);
 
-/*	case HDM_SETFILTERCHANGETIMEOUT: */
+        case HDM_SETFILTERCHANGETIMEOUT:
+            return HEADER_SetFilterChangeTimeout(infoPtr, (INT)lParam);
 
         case HDM_SETHOTDIVIDER:
             return HEADER_SetHotDivider(infoPtr, wParam, lParam);
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index 43fd175..3dc102d 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -994,8 +994,19 @@ static void test_hdm_filterMessages(HWND hParent)
     ok_sequence(sequences, PARENT_SEQ_INDEX, add_header_to_parent_seq,
                                     "adder header control to parent", FALSE);
 
+    timeout = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 0, 0);
+    ok(timeout == 1000, "got %d\n", timeout);
+
+    timeout = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 0, 0);
+    ok(timeout == 1000, "got %d\n", timeout);
+
+    timeout = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 0, -100);
+    ok(timeout == 1000, "got %d\n", timeout);
+
     timeout = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
-    SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, timeout);
+    ok(timeout == -100, "got %d\n", timeout);
+    retVal = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, timeout);
+    ok(retVal == 100, "got %d\n", retVal);
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 




More information about the wine-cvs mailing list