28#define DEFAULT_MIN_TAB_WIDTH 54
29#define TAB_PADDING_X 6
30#define EXTRA_ICON_PADDING 3
33#define NUM_MSG_SEQUENCES 2
34#define PARENT_SEQ_INDEX 0
35#define TAB_SEQ_INDEX 1
37#define expect(expected, got) ok ( expected == got, "Expected %d, got %d\n", expected, got)
38#define expect_str(expected, got)\
39 ok ( strcmp(expected, got) == 0, "Expected '%s', got '%s'\n", expected, got)
41#define TabWidthPadded(padd_x, num) (DEFAULT_MIN_TAB_WIDTH - (TAB_PADDING_X - (padd_x)) * num)
54 ok_(__FILE__,
line) (
width ==
r.right -
r.left,
"%s: Expected width [%d] got [%d]\n",
57 ok_(__FILE__,
line) (
height ==
r.bottom -
r.top,
"%s: Expected height [%d] got [%d]\n",
62 r.right -
r.left,
r.bottom -
r.top);
65#define CHECKSIZE(hwnd,width,height,msg) CheckSize(hwnd,width,height,msg,__LINE__)
71 MAKELPARAM((set_width >= 0) ? set_width : 0, (set_height >= 0) ? set_height : 0));
76#define TABCHECKSETSIZE(hwnd,set_width,set_height,exp_width,exp_height,msg) \
77 TabCheckSetSize(hwnd,set_width,set_height,exp_width,exp_height,msg,__LINE__)
228 static char text1[] =
"Tab 1",
229 text2[] =
"Wide Tab 2",
263 static LONG defwndproc_counter = 0;
297 defwndproc_counter++;
299 defwndproc_counter--;
326 return CreateWindowExA(0,
"Tab test parent class",
"Tab test parent window",
334 static LONG defwndproc_counter = 0;
355 defwndproc_counter++;
357 defwndproc_counter--;
375 ok(tabHandle !=
NULL,
"failed to create tab wnd\n");
382 for (
i = 0;
i < nTabs;
i++)
407 LPSTR lptstr = toolTipText;
452 if (nMinTabWidth < 0)
459 trace(
"Tab1 text size: size.cx=%d size.cy=%d\n",
size.cx,
size.cy);
463 trace (
" TCS_FIXEDWIDTH tabs no icon...\n");
470 trace (
" TCS_FIXEDWIDTH tabs with icon...\n");
483 trace (
" TCS_FIXEDWIDTH buttons no icon...\n");
491 trace (
" TCS_FIXEDWIDTH buttons with icon...\n");
506 trace (
" TCS_FIXEDWIDTH | TCS_BOTTOM tabs...\n");
526 trace (
" non fixed width, with text...\n");
530 "no icon, default width: Expected width [%d] got [%d]\n",
exp, rTab.
right - rTab.
left );
554 trace (
" non fixed width, no text...\n");
558 "no icon, default width: Expected width [%d] got [%d]\n",
exp, rTab.
right - rTab.
left );
574 TABCHECKSETSIZE(hwTab, 50, 30, nTabWidth, 30,
"with icon, set size > icon");
575 TABCHECKSETSIZE(hwTab, 20, 20, nTabWidth, 20,
"with icon, set size < icon");
581 pImageList_Destroy(
himl);
586 trace (
"Testing with default MinWidth\n");
588 trace (
"Testing with MinWidth set to -3\n");
590 trace (
"Testing with MinWidth set to 24\n");
592 trace (
"Testing with MinWidth set to 54\n");
594 trace (
"Testing with MinWidth set to 94\n");
605 ok(hTab !=
NULL,
"Failed to create tab control\n");
611 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
613 ok(
ret == nTabs - 1,
"Unexpected focus index %d.\n",
ret);
617 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
619 ok(
ret == -1,
"Unexpected focus index %d.\n",
ret);
623 ok(
ret == -1,
"Unexpected focus index %d.\n",
ret);
626 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
628 ok(
ret == 1,
"Unexpected focus index %d.\n",
ret);
637 ok(hTab !=
NULL,
"Failed to create tab control\n");
643 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
645 ok(
ret == nTabs - 1,
"Unexpected focus index %d.\n",
ret);
649 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
652 ok(
ret == nTabs - 1,
"Unexpected focus index %d.\n",
ret);
657 ok(
ret == 0,
"Unexpected focus index %d.\n",
ret);
660 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
663 ok(
ret == nTabs - 1,
"Unexpected focus index %d.\n",
ret);
680 ok(hTab !=
NULL,
"Failed to create tab control\n");
686 expect(0, selectionIndex);
688 expect(nTabs-1, selectionIndex);
692 expect(nTabs-1, focusIndex);
697 expect(-1, selectionIndex);
701 expect(-1, selectionIndex);
704 expect(-1, selectionIndex);
706 expect(1, selectionIndex);
719 "Selected item should have TCIS_BUTTONPRESSED\n");
723 ok(focusIndex == 1,
"got %d\n", focusIndex);
726 ok(selectionIndex == 1,
"got %d\n", selectionIndex);
732 ok(focusIndex == -1,
"got %d\n", focusIndex);
745 DWORD prevExtendedStyle;
750 ok(hTab !=
NULL,
"Failed to create tab control\n");
757 expect(extendedStyle, prevExtendedStyle);
764 expect(extendedStyle, prevExtendedStyle);
784 ok(hTab !=
NULL,
"Failed to create tab control\n");
811 char szText[32] =
"New Label";
850 ok(hTab !=
NULL,
"Failed to create tab control\n");
856 memset(&tcItem, 0xcc,
sizeof(tcItem));
860 ok(tcItem.
lParam == 0,
"Expected zero lParam, got %lu\n", tcItem.
lParam);
862 memset(&tcItem, 0xcc,
sizeof(tcItem));
868 memset(&tcItem, 0xcc,
sizeof(tcItem));
876 memset(&tcItem, 0xcc,
sizeof(tcItem));
884 memset(&tcItem, 0xcc,
sizeof(tcItem));
890 ok(tcItem.
dwState == 0,
"Expected zero dwState\n");
893 memset(&tcItem, 0xcc,
sizeof(tcItem));
897 ok(tcItem.
lParam == 0,
"Expected zero lParam, got %lu\n", tcItem.
lParam);
899 memset(&tcItem, 0xcc,
sizeof(tcItem));
903 ok(tcItem.
lParam == 0,
"Expected zero lParam, got %lu\n", tcItem.
lParam);
911 strcpy(szText,
"New Label");
923 memset(&tcItem, 0,
sizeof(tcItem));
947 else win_skip(
"Item state mask not supported\n" );
954 char toolTipText[32] =
"ToolTip Text Test";
960 ok(hTab !=
NULL,
"Failed to create tab control\n");
966 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
968 ok(toolTip ==
hwnd,
"Unexpected tooltip window.\n");
971 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
973 ok(
hwnd ==
NULL,
"Unexpected tooltip window.\n");
974 ok(
IsWindow(toolTip),
"Expected tooltip window to be alive.\n");
991 ok(hTab !=
NULL,
"Failed to create tab control\n");
1007 static char tabName[] =
"TAB";
1014 ok(hTab !=
NULL,
"Failed to create tab control\n");
1022 expect(0, nTabsRetrieved);
1032 expect(1, nTabsRetrieved);
1042 expect(2, nTabsRetrieved);
1075 ok(hTab !=
NULL,
"Failed to create tab control\n");
1080 expect(2, nTabsRetrieved);
1089 expect(1, nTabsRetrieved);
1104 expect(0, nTabsRetrieved);
1125 pImageList_ReplaceIcon(
himl, -1, hicon);
1126 pImageList_ReplaceIcon(
himl, -1, hicon);
1127 pImageList_ReplaceIcon(
himl, -1, hicon);
1135 for(
i = 0;
i < 3;
i++) {
1142 i = pImageList_GetImageCount(
himl);
1143 ok(
i == 2,
"Unexpected image count %d.\n",
i);
1155 i = pImageList_GetImageCount(
himl);
1156 ok(
i == 1,
"Unexpected image count %d.\n",
i);
1168 i = pImageList_GetImageCount(
himl);
1169 ok(
i == 0,
"Unexpected image count %d.\n",
i);
1170 for(
i = 0;
i < 3;
i++) {
1177 pImageList_Destroy(
himl);
1187 ok(hTab !=
NULL,
"Failed to create tab control\n");
1219 win_skip(
"TCM_SETITEMEXTRA not supported\n");
1233 ok(hTab !=
NULL,
"Failed to create tab control\n");
1249 ok(hTab !=
NULL,
"Failed to create tab control\n");
1267 memset(&itemdata, 0xde, 4);
1328 itemdata = itemdata2 = 0;
1329 memset(&itemdata, 0xde, 4);
1342 ok(hTab !=
NULL,
"Failed to create tab control\n");
1376 ok(
style ==
ptr->act_style,
"expected style 0x%08x, got style 0x%08x\n",
ptr->act_style,
style);
1387#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1397 const INT nTabs = 5;
1402 ok(hTab !=
NULL,
"Failed to create tab control\n");
1406 ok(
ret == 0,
"Unexpected tab focus %d.\n",
ret);
1412 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
1421 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
1426 ok(
ret == nTabs - 1,
"Unexpected focused tab %d.\n",
ret);
1428 ok(
ret == nTabs - 1,
"Unexpected selected tab %d.\n",
ret);
1435 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
1441 ok(
ret == nTabs - 1,
"Unexpected focused tab %d.\n",
ret);
1444 ok(
ret == nTabs - 1,
"Unexpected selected tab %d.\n",
ret);
1450 ok(
ret == 0,
"Unexpected ret value %d.\n",
ret);
1455 ok(
ret == -1,
"Unexpected focused tab %d.\n",
ret);
1464 const INT nTabs = 5;
1471 ok(hTab !=
NULL,
"Failed to create tab control\n");
1489 memset(&logfont, 0,
sizeof(logfont));
ACPI_SIZE strlen(const char *String)
static void init_msg_sequences(struct msg_sequence **seq, int n)
static void flush_sequences(struct msg_sequence **seq, int n)
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
#define EXTRA_ICON_PADDING
#define DEFAULT_MIN_TAB_WIDTH
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
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
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define sprintf(buf, format,...)
static void test_tab(void)
static void test_cursel(void)
static void test_curfocus(void)
static void test_delete_selection(void)
static const struct message getset_cur_sel_seq[]
static const struct message rbuttonup_seq[]
static const struct message getset_cur_focus_seq[]
static const struct message getset_unicode_format_seq[]
#define expect_str(expected, got)
static void test_extendedstyle(void)
static void test_width(void)
#define TABCHECKSETSIZE(hwnd, set_width, set_height, exp_width, exp_height, msg)
#define NUM_MSG_SEQUENCES
static HWND create_tooltip(HWND hTab, char toolTipText[])
static const struct message insert_focus_seq[]
static BOOL registerParentWindowClass(void)
static void TabCheckSetSize(HWND hwnd, INT set_width, INT set_height, INT exp_width, INT exp_height, const char *msg, int line)
static void test_TCS_OWNERDRAWFIXED(void)
static void test_create(void)
static void test_removeimage(void)
static const struct message full_selchange_parent_seq[]
static const struct message getset_tooltip_parent_seq[]
#define CHECKSIZE(hwnd, width, height, msg)
static const struct message getset_tooltip_seq[]
#define TabWidthPadded(padd_x, num)
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static const struct message get_row_count_seq[]
static LRESULT WINAPI tab_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static void test_getset_tooltips(void)
static const struct message delete_focus_seq[]
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
static const struct message selchange_parent_seq[]
static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int line)
static const struct message setfocus_parent_seq[]
#define expect(expected, got)
static void test_unicodeformat(void)
static const struct message empty_sequence[]
static HWND create_tabcontrol(DWORD style, DWORD mask)
static LRESULT tcn_selchanging_result
static const struct message getset_item_seq[]
static void test_getset_item(void)
static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT nTabs)
static const struct message selchanging_parent_seq[]
static void test_TCM_SETITEMEXTRA(void)
static void test_adjustrect(void)
static HWND createParentWindow(void)
static void test_TCM_GETROWCOUNT(void)
static const struct tabcreate_style create_styles[]
static void init_functions(void)
static void test_delete_focus(void)
static void test_TCN_SELCHANGING(void)
static const struct message getset_extended_style_seq[]
static DRAWITEMSTRUCT g_drawitem
static void test_insert_focus(void)
static void test_WM_CONTEXTMENU(void)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define TCS_EX_REGISTERDROP
#define TCS_EX_FLATSEPARATORS
#define TCS_OWNERDRAWFIXED
#define TCIS_BUTTONPRESSED
struct _IMAGELIST * HIMAGELIST
#define CCM_SETUNICODEFORMAT
#define CCM_GETUNICODEFORMAT
#define TCM_SETEXTENDEDSTYLE
#define TCM_GETEXTENDEDSTYLE
#define TCM_GETUNICODEFORMAT
#define TCM_SETMINTABWIDTH
#define TCM_SETUNICODEFORMAT
struct tagTOOLINFOA TTTOOLINFOA
CHAR lfFaceName[LF_FACESIZE]
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
static struct wctab tab[]
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI GetTextExtentPoint32A(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SetWindowLongPtrA
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI CreateIcon(_In_opt_ HINSTANCE, _In_ int, _In_ int, _In_ BYTE, _In_ BYTE, _In_ const BYTE *, _In_ const BYTE *)
#define WM_WINDOWPOSCHANGING
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GetWindowLongPtrA
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HDC WINAPI GetDC(_In_opt_ HWND)
HWND WINAPI GetParent(_In_ HWND)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
BOOL WINAPI DestroyIcon(_In_ HICON)