Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
Proves previous patch's behavior.
dlls/comctl32/tests/listbox.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index ad341c5..e7777d1 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -436,6 +436,32 @@ static void test_ownerdraw(void) DestroyWindow(parent); }
+static void test_both_ownerdraw(void) +{ + HWND hLB; + INT ret; + + /* test both FIXED and VARIABLE at once, since FIXED should override VARIABLE */ + hLB = CreateWindowA(WC_LISTBOXA, "TestList", LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE, 0, 0, 100, 100, NULL, NULL, NULL, 0); + ok(hLB != NULL, "last error 0x%08x\n", GetLastError()); + if (!hLB) return; + + ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); + ok(ret == 0, "expected 0, got %d\n", ret); + ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0); + ok(ret == 1, "expected 1, got %d\n", ret); + + ret = SendMessageA(hLB, LB_SETITEMHEIGHT, 0, 13); + ok(ret == LB_OKAY, "LB_SETITEMHEIGHT failed: %d\n", ret); + ret = SendMessageA(hLB, LB_SETITEMHEIGHT, 1, 42); + ok(ret == LB_OKAY, "LB_SETITEMHEIGHT failed: %d\n", ret); + + ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); + ok(ret == 42, "LBS_OWNERDRAWFIXED did not override LBS_OWNERDRAWVARIABLE, got height %d\n", ret); + + DestroyWindow (hLB); +} + #define listbox_test_query(exp, got) \ ok(exp.selected == got.selected, "expected selected %d, got %d\n", exp.selected, got.selected); \ ok(exp.anchor == got.anchor, "expected anchor %d, got %d\n", exp.anchor, got.anchor); \ @@ -2216,6 +2242,7 @@ START_TEST(listbox) test_listbox(); test_item_height(); test_ownerdraw(); + test_both_ownerdraw(); test_LB_SELITEMRANGE(); test_LB_SETCURSEL(); test_listbox_height();