Nikolay Sivov : comctl32/treeview: Added a test for NM_RETURN.
Alexandre Julliard
julliard at winehq.org
Mon May 12 15:35:48 CDT 2014
Module: wine
Branch: master
Commit: a709e3f98dc807c2423ce5ea1d39902777f07f33
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a709e3f98dc807c2423ce5ea1d39902777f07f33
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon May 12 13:18:36 2014 +0400
comctl32/treeview: Added a test for NM_RETURN.
---
dlls/comctl32/tests/treeview.c | 31 +++++++++++++++++++++++++++++++
dlls/comctl32/treeview.c | 2 +-
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index cd619a9..3b70e6c 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -252,6 +252,13 @@ static const struct message parent_cd_seq[] = {
{ 0 }
};
+static const struct message parent_vk_return_seq[] = {
+ { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN },
+ { WM_NOTIFY, sent|id, 0, 0, NM_RETURN },
+ { WM_CHANGEUISTATE, sent|optional },
+ { 0 }
+};
+
static HWND hMainWnd;
static HTREEITEM hRoot, hChild;
@@ -2126,6 +2133,29 @@ static void test_customdraw(void)
DestroyWindow(hwnd);
}
+static void test_WM_KEYDOWN(void)
+{
+ static const char *rootA = "root";
+ TVINSERTSTRUCTA ins;
+ HTREEITEM hRoot;
+ HWND hwnd;
+
+ hwnd = create_treeview_control(0);
+
+ ins.hParent = TVI_ROOT;
+ ins.hInsertAfter = TVI_ROOT;
+ U(ins).item.mask = TVIF_TEXT;
+ U(ins).item.pszText = (char*)rootA;
+ hRoot = TreeView_InsertItemA(hwnd, &ins);
+ ok(hRoot != NULL, "got %p\n", hRoot);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ SendMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_vk_return_seq, "WM_KEYDOWN/VK_RETURN parent notification", TRUE);
+
+ DestroyWindow(hwnd);
+}
+
START_TEST(treeview)
{
HMODULE hComctl32;
@@ -2200,6 +2230,7 @@ START_TEST(treeview)
test_TVM_HITTEST();
test_WM_GETDLGCODE();
test_customdraw();
+ test_WM_KEYDOWN();
if (!load_v6_module(&ctx_cookie, &hCtx))
{
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index bb42b21..6dd7e93 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -5261,7 +5261,7 @@ TREEVIEW_KeyDown(TREEVIEW_INFO *infoPtr, WPARAM wParam)
case VK_RETURN:
TREEVIEW_SendSimpleNotify(infoPtr, NM_RETURN);
- break;
+ break;
case VK_HOME:
newSelection = infoPtr->root->firstChild;
More information about the wine-cvs
mailing list