25#define WIN32_LEAN_AND_MEAN
32#define COMBO_YBORDERSIZE() 2
36#define expect_eq(expr, value, type, fmt); { type val = expr; ok(val == (value), #expr " expected " #fmt " got " #fmt "\n", (value), val); }
37#define expect_rect(r, _left, _top, _right, _bottom) ok(r.left == _left && r.top == _top && \
38 r.bottom == _bottom && r.right == _right, "Invalid rect %s vs (%d,%d)-(%d,%d)\n", \
39 wine_dbgstr_rect(&r), _left, _top, _right, _bottom);
43 return CreateWindowA(
"ComboBox",
"Combo",
WS_VISIBLE|
WS_CHILD|
style, 5, 5, 100, 100,
hMainWnd, (
HMENU)
COMBO_ID,
NULL, 0);
87 for (
i = 1;
i < 30;
i++)
100 HFONT hFont1, hFont2;
106 skip(
"Marlett font not available\n");
113 hFont1 =
CreateFontA(10, 0, 0, 0,
FW_DONTCARE,
FALSE,
FALSE,
FALSE,
SYMBOL_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|
FF_DONTCARE,
"Marlett");
114 hFont2 =
CreateFontA(8, 0, 0, 0,
FW_DONTCARE,
FALSE,
FALSE,
FALSE,
SYMBOL_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|
FF_DONTCARE,
"Marlett");
151 ok(0,
"Expected Marlett font heights 10/8, got %d/%d\n",
155 for (
i = 1;
i < 30;
i++)
157 HFONT hFont =
CreateFontA(
i, 0, 0, 0,
FW_DONTCARE,
FALSE,
FALSE,
FALSE,
SYMBOL_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|
FF_DONTCARE,
"Marlett");
188 char list[20], edit[20];
191 memset(edit, 0,
sizeof(edit));
213 const int *edit,
const int *
list)
227 ok(
idx == -1,
"expected selection -1, got %d\n",
idx);
269 static const char *
const text[] = {
"alpha",
"beta",
"" };
270 static const int sel_1[] = { 2, 0, 1, 0, 1 };
271 static const int sel_2[] = { 0, 1, 0, 0, 1 };
287 static const UINT choices[] = {8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
298 "Failed to add item %d\n",
i);
304 ok(
ret,
"Failed to get combobox info structure. LastError=%d\n",
316 ok(
result,
"WM_LBUTTONDOWN was not processed. LastError=%d\n",
319 "The dropdown list should have appeared after clicking the button.\n");
322 "Focus not on ComboBox's Edit Control, instead on %p\n",
GetFocus());
324 ok(
result,
"WM_LBUTTONUP was not processed. LastError=%d\n",
327 "Focus not on ComboBox's Edit Control, instead on %p\n",
GetFocus());
333 y = item_height/2 + item_height*4;
335 ok(!
result,
"WM_LBUTTONDOWN was not processed. LastError=%d\n",
338 "Focus not on ComboBox's Edit Control, instead on %p\n",
GetFocus());
341 ok(!
result,
"WM_MOUSEMOVE was not processed. LastError=%d\n",
344 "Focus not on ComboBox's Edit Control, instead on %p\n",
GetFocus());
346 "The dropdown list should still be visible.\n");
349 ok(!
result,
"WM_LBUTTONUP was not processed. LastError=%d\n",
352 "Focus not on ComboBox's Edit Control, instead on %p\n",
GetFocus());
354 "The dropdown list should have been rolled up.\n");
356 ok(
idx,
"Current Selection: expected %d, got %d\n", 4,
idx);
365 INT ddheight, clheight, ddwidth, clwidth;
377 ok( rc.
right - rc.
left == clwidth - 2,
"clientrect width is %d vs %d\n",
379 ok( rc.
bottom - rc.
top == clheight,
"clientrect height is %d vs %d\n",
382 ok( rc.
right - rc.
left == clwidth - 2,
"drop-down rect width is %d vs %d\n",
384 ok( rc.
bottom - rc.
top == ddheight,
"drop-down rect height is %d vs %d\n",
386 ok( rc.
right - rc.
left == ddwidth -2,
"drop-down rect width is %d vs %d\n",
391 ok( rc.
right - rc.
left == clwidth + 2,
"clientrect width is %d vs %d\n",
393 ok( rc.
bottom - rc.
top == clheight,
"clientrect height is %d vs %d\n",
396 ok( rc.
right - rc.
left == clwidth + 2,
"drop-down rect width is %d vs %d\n",
399 ok( rc.
bottom - rc.
top == clheight + 2,
"drop-down rect height is %d vs %d\n",
404 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
406 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
409 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
411 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
414 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
416 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
419 ok( ddwidth == (clwidth << 1),
"drop-width is %d vs %d\n", ddwidth, clwidth << 1);
421 ok( ddwidth == (clwidth << 1),
"drop-width is %d vs %d\n", ddwidth, clwidth << 1);
424 ok( ddwidth == (clwidth << 1),
"drop-width is %d vs %d\n", ddwidth, clwidth << 1);
426 ok( ddwidth == (clwidth << 1),
"drop-width is %d vs %d\n", ddwidth, clwidth << 1);
429 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
431 ok( ddwidth == clwidth + 2,
"drop-width is %d vs %d\n", ddwidth, clwidth + 2);
451 ok(
ret,
"Failed to get combobox info structure. LastError=%d\n",
464 ok(
strcmp(edit,
"Jason1")==0,
"Unexpected text retrieved %s\n", edit);
468 ok(
start==0,
"Unexpected start position for selection %d\n",
start);
469 ok(
end==0,
"Unexpected end position for selection %d\n",
end);
477 ok(
start==0,
"Unexpected start position for selection %d\n",
start);
478 ok(
end==6,
"Unexpected end position for selection %d\n",
end);
487 ok(
strcmp(edit,
"A")==0,
"Unexpected text retrieved %s\n", edit);
505 ok(
ret,
"Failed to get combobox info structure. LastError=%d\n",
513 ok(
strcmp(edit,
"Jason2")==0,
"Unexpected text retrieved %s\n", edit);
519 ok(
start==0,
"Unexpected start position for selection %d\n",
start);
520 ok(
end==6,
"Unexpected end position for selection %d\n",
end);
531 ok(
strcmp(edit,
"Jason2A")==0,
"Unexpected text retrieved %s\n", edit);
584 ok(
ret,
"Failed to get COMBOBOXINFO structure; LastError: %u\n",
GetLastError());
604 ok(
GetFocus() == hButton,
"hButton should have keyboard focus\n");
619 ok(
GetFocus() == hButton,
"hButton should have keyboard focus\n");
651 ok(
ret,
"Failed to get combobox info structure.\n");
656 ok(exstyle == expect_exstyle,
"%08x: got %08x\n", cb_style, exstyle);
665 ok(exstyle == expect_exstyle,
"%08x: got %08x\n", cb_style, exstyle);
671 ok(exstyle == expect_exstyle,
"%08x: got %08x\n", cb_style, exstyle);
685 static const struct list_size_info
714 const struct list_size_info *info_test = &info_height[
test];
717 int expected_count_list;
718 int expected_height_list;
719 int list_height_nonclient;
720 int list_height_calculated;
721 RECT rect_list_client, rect_list_complete;
729 ok(
ret,
"Failed to get COMBOBOXINFO structure; LastError: %u\n",
GetLastError());
732 for (
i = 0;
i < info_test->num_items;
i++)
739 ok(
ret,
"WM_LBUTTONDOWN was not processed. LastError=%d\n",
742 "The dropdown list should have appeared after clicking the button.\n");
746 height_list = rect_list_client.
bottom - rect_list_client.
top;
749 list_height_nonclient = (rect_list_complete.
bottom - rect_list_complete.
top)
750 - (rect_list_client.
bottom - rect_list_client.
top);
753 list_height_calculated = info_test->height_combo
755 - list_height_nonclient
758 expected_count_list = list_height_calculated / height_item;
759 if(expected_count_list < 0)
760 expected_count_list = 0;
761 expected_count_list =
min(expected_count_list, info_test->num_items);
762 expected_height_list = expected_count_list * height_item;
765 ok(expected_height_list == height_list,
766 "Test %d, expected list height to be %d, got %d\n",
test, expected_height_list, height_list);
785 ok(
ret,
"Failed to get COMBOBOXINFO structure; LastError: %u\n",
GetLastError());
788 for(
i = 0;
i < 3;
i++)
809 hMainWnd =
CreateWindowA(
"static",
"Test",
WS_OVERLAPPEDWINDOW, 10, 10, 300, 300,
NULL,
NULL,
NULL, 0);
int strcmp(const char *String1, const char *String2)
static const WCHAR stringFormat[]
#define COMBO_YBORDERSIZE()
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define sprintf(buf, format,...)
static BOOL selchange_fired
static LRESULT CALLBACK combobox_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
static HWND hCBN_KillFocus
#define expect_rect(r, _left, _top, _right, _bottom)
static LPCSTR expected_edit_text
static UINT WPARAM wparam
static UINT WPARAM LPARAM lparam
static LRESULT CALLBACK test_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
static WNDPROC edit_window_proc
static HWND hCBN_SetFocus
static LPCSTR expected_list_text
static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static void test_selection(void)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define todo_wine_if(is_todo)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static void test_editselection(void)
static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam)
static void test_listbox_styles(DWORD cb_style)
static void test_setitemheight(DWORD style)
static void test_setfont(DWORD style)
#define expect_eq(expr, value, type, fmt)
static void test_listbox_size(DWORD style)
static void test_editselection_focus(DWORD style)
static void test_changesize(DWORD style)
static HWND build_combo(DWORD style)
static void test_WS_VSCROLL(void)
static void test_WM_LBUTTONDOWN(void)
static BOOL is_font_installed(const char *name)
static void test_CBN_SELCHANGE(void)
static int font_height(HFONT hFont)
#define WS_OVERLAPPEDWINDOW
#define expect_style(window, style)
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
#define OUT_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
BOOL WINAPI DeleteDC(_In_ HDC)
HWND WINAPI GetFocus(void)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SetWindowLongPtrA
#define CB_SETDROPPEDWIDTH
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GetWindowLongPtrA
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define CB_GETDROPPEDWIDTH
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CB_GETDROPPEDCONTROLRECT
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
struct tagCOMBOBOXINFO COMBOBOXINFO
HDC WINAPI GetDC(_In_opt_ HWND)
#define CB_GETDROPPEDSTATE
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)