From: Ilia Docin ilya.docin@contentai.ru
--- dlls/comctl32/tests/rebar.c | 47 +++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 7cafa4ba52b..74ab5c09d0b 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -121,6 +121,7 @@ static HWND build_toolbar(int nr, HWND hParent) }
static int g_parent_measureitem; +static RECT g_chevron_rect;
static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -129,8 +130,17 @@ static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY: { NMHDR *lpnm = (NMHDR *)lParam; - if (lpnm->code == RBN_HEIGHTCHANGE) - GetClientRect(lpnm->hwndFrom, &height_change_notify_rect); + switch (lpnm->code) + { + case RBN_HEIGHTCHANGE: + GetClientRect(lpnm->hwndFrom, &height_change_notify_rect); + break; + case RBN_CHEVRONPUSHED: + g_chevron_rect = ((NMREBARCHEVRON *)lParam)->rc; + break; + default: + break; + } } break; case WM_MEASUREITEM: @@ -1178,6 +1188,38 @@ static void init_functions(void) #undef X }
+static void test_chevron(void) +{ + HWND hRebar; + REBARBANDINFOA rbi; + + hRebar = create_rebar_control(0); + rbi.cbSize = REBARBANDINFOA_V6_SIZE; + rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE | RBBIM_STYLE; + rbi.cxIdeal = 128; + rbi.cx = rbi.cxIdeal - 1; + rbi.cxMinChild = 100; + rbi.cyMinChild = rbi.cxMinChild; + rbi.hwndChild = build_toolbar(1, hRebar); + rbi.fStyle = RBBS_USECHEVRON | RBBS_NOGRIPPER; + SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rbi); + + SetRectEmpty(&g_chevron_rect); + SendMessageA(hRebar, RB_PUSHCHEVRON, 0, 0); + ok(!IsRectEmpty(&g_chevron_rect), "Unexpected empty chevron rect\n"); + + /* increase band width to make it more then ideal value to hide chevron */ + rbi.fMask = RBBIM_SIZE; + rbi.cx = rbi.cxIdeal << 1; + SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rbi); + + SendMessageA(hRebar, RB_PUSHCHEVRON, 0, 0); + ok(IsRectEmpty(&g_chevron_rect), "Unexpected non-empty chevron rect\n"); + + DestroyWindow(hRebar); +} + START_TEST(rebar) { MSG msg; @@ -1201,6 +1243,7 @@ START_TEST(rebar) test_layout(); test_resize(); test_style(); + test_chevron();
out: PostQuitMessage(0);