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",
244 tcNewTab.pszText = text2;
247 tcNewTab.pszText = text3;
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);
737 ok(tcItem.dwState == 0,
"got state %d\n", tcItem.dwState);
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";
845 ok(tcItem.lParam ==
lparam,
"Expected 0x%lx, got 0x%lx\n",
lparam, tcItem.lParam);
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));
878 tcItem.dwStateMask = 0;
882 ok(tcItem.dwState == 0,
"Expected zero dwState, got %u\n", tcItem.dwState);
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);
908 tcItem.pszText = &
szText[0];
909 tcItem.cchTextMax =
sizeof(
szText);
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);
1037 tcNewTab.iImage = 2;
1042 expect(2, nTabsRetrieved);
1053 tcNewTab.iImage = 3;
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));
HGDIOBJ WINAPI GetStockObject(_In_ int)
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
static const struct message selchanging_parent_seq[]
static BOOL(WINAPI *pImageList_Destroy)(HIMAGELIST)
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
static const struct message getset_extended_style_seq[]
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
GLint GLint GLsizei width
static const struct message get_row_count_seq[]
static void test_TCS_OWNERDRAWFIXED(void)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
static const struct message getset_cur_focus_seq[]
#define TCM_SETUNICODEFORMAT
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define TCS_EX_REGISTERDROP
#define TABCHECKSETSIZE(hwnd, set_width, set_height, exp_width, exp_height, msg)
HDC WINAPI GetDC(_In_opt_ HWND)
ACPI_SIZE strlen(const char *String)
BOOL WINAPI DestroyIcon(_In_ HICON)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static void test_getset_item(void)
static void test_tab(INT nMinTabWidth)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT nTabs)
#define CHECKSIZE(hwnd, width, height, msg)
static const struct message getset_tooltip_seq[]
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * message
static const struct message getset_unicode_format_seq[]
static BOOL registerParentWindowClass(void)
#define TabWidthPadded(padd_x, num)
static void test_delete_selection(void)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define EXTRA_ICON_PADDING
static HWND create_tooltip(HWND hTab, char toolTipText[])
static void TabCheckSetSize(HWND hwnd, INT set_width, INT set_height, INT exp_width, INT exp_height, const char *msg, int line)
#define CCM_GETUNICODEFORMAT
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void test_cursel(void)
static const struct tabcreate_style create_styles[]
#define TCS_EX_FLATSEPARATORS
BOOL WINAPI DestroyWindow(_In_ HWND)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
static void test_insert_focus(void)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
static HIMAGELIST(WINAPI *pImageList_Create)(INT
#define sprintf(buf, format,...)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int line)
static const WCHAR szText[]
#define TCIS_BUTTONPRESSED
static UINT WPARAM LPARAM lparam
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
static const struct message empty_sequence[]
static void init_msg_sequences(struct msg_sequence **seq, int n)
static void test_width(void)
#define TCM_SETEXTENDEDSTYLE
HWND WINAPI GetDesktopWindow(void)
#define TCM_SETMINTABWIDTH
static const struct message insert_focus_seq[]
static void init_functions(void)
static LRESULT WINAPI tab_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static void test_create(void)
static void test_TCM_SETITEMEXTRA(void)
#define expect(expected, got)
#define GetWindowLongPtrA
static void test_adjustrect(void)
#define expect_str(expected, got)
static const struct message full_selchange_parent_seq[]
static const struct message getset_item_seq[]
#define WM_WINDOWPOSCHANGING
HICON WINAPI CreateIcon(_In_opt_ HINSTANCE, _In_ int, _In_ int, _In_ BYTE, _In_ BYTE, _In_ const BYTE *, _In_ const BYTE *)
#define ok_sequence(seq, index, exp, contx, todo)
#define TCM_GETUNICODEFORMAT
static void test_getset_tooltips(void)
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static const struct message setfocus_parent_seq[]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define TCS_OWNERDRAWFIXED
#define DEFAULT_MIN_TAB_WIDTH
BOOL WINAPI GetTextExtentPoint32A(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
static void test_extendedstyle(void)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define SetWindowLongPtrA
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void test_TCM_GETROWCOUNT(void)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
static void test_unicodeformat(void)
GLint GLint GLsizei GLsizei height
static HWND create_tabcontrol(DWORD style, DWORD mask)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static const struct message getset_tooltip_parent_seq[]
HWND WINAPI GetParent(_In_ HWND)
static void test_removeimage(void)
static void test_TCN_SELCHANGING(void)
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 CCM_SETUNICODEFORMAT
static void flush_sequences(struct msg_sequence **seq, int n)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
static void test_curfocus(void)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const struct message rbuttonup_seq[]
static const struct message selchange_parent_seq[]
struct tagTOOLINFOA TTTOOLINFOA
char * strcpy(char *DstString, const char *SrcString)
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)
CHAR lfFaceName[LF_FACESIZE]
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
static void test_WM_CONTEXTMENU(void)
static HWND createParentWindow(void)
static const struct message getset_cur_sel_seq[]
#define TCM_GETEXTENDEDSTYLE
static DRAWITEMSTRUCT g_drawitem
#define NUM_MSG_SEQUENCES
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
static void test_delete_focus(void)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
static UINT WPARAM wparam
static const struct message delete_focus_seq[]
static LRESULT tcn_selchanging_result