Commit bf152cb0 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/button: Fix dialog code for new button types.

parent fc3ea7d1
...@@ -237,12 +237,16 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L ...@@ -237,12 +237,16 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case WM_GETDLGCODE: case WM_GETDLGCODE:
switch(btn_type) switch(btn_type)
{ {
case BS_COMMANDLINK:
case BS_USERBUTTON: case BS_USERBUTTON:
case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON; case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON;
case BS_DEFCOMMANDLINK:
case BS_DEFPUSHBUTTON: return DLGC_BUTTON | DLGC_DEFPUSHBUTTON; case BS_DEFPUSHBUTTON: return DLGC_BUTTON | DLGC_DEFPUSHBUTTON;
case BS_RADIOBUTTON: case BS_RADIOBUTTON:
case BS_AUTORADIOBUTTON: return DLGC_BUTTON | DLGC_RADIOBUTTON; case BS_AUTORADIOBUTTON: return DLGC_BUTTON | DLGC_RADIOBUTTON;
case BS_GROUPBOX: return DLGC_STATIC; case BS_GROUPBOX: return DLGC_STATIC;
case BS_SPLITBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON | DLGC_WANTARROWS;
case BS_DEFSPLITBUTTON: return DLGC_BUTTON | DLGC_DEFPUSHBUTTON | DLGC_WANTARROWS;
default: return DLGC_BUTTON; default: return DLGC_BUTTON;
} }
......
...@@ -511,6 +511,18 @@ static void test_button_messages(void) ...@@ -511,6 +511,18 @@ static void test_button_messages(void)
{ BS_OWNERDRAW, DLGC_BUTTON, { BS_OWNERDRAW, DLGC_BUTTON,
setfocus_ownerdraw_seq, killfocus_ownerdraw_seq, setstyle_ownerdraw_seq, setfocus_ownerdraw_seq, killfocus_ownerdraw_seq, setstyle_ownerdraw_seq,
setstate_ownerdraw_seq, clearstate_ownerdraw_seq, setcheck_ignored_seq }, setstate_ownerdraw_seq, clearstate_ownerdraw_seq, setcheck_ignored_seq },
{ BS_SPLITBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON | DLGC_WANTARROWS,
setfocus_seq, killfocus_seq, setstyle_seq,
setstate_seq, setstate_seq, setcheck_ignored_seq },
{ BS_DEFSPLITBUTTON, DLGC_BUTTON | DLGC_DEFPUSHBUTTON | DLGC_WANTARROWS,
setfocus_seq, killfocus_seq, setstyle_seq,
setstate_seq, setstate_seq, setcheck_ignored_seq },
{ BS_COMMANDLINK, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON,
setfocus_seq, killfocus_seq, setstyle_seq,
setstate_seq, setstate_seq, setcheck_ignored_seq },
{ BS_DEFCOMMANDLINK, DLGC_BUTTON | DLGC_DEFPUSHBUTTON,
setfocus_seq, killfocus_seq, setstyle_seq,
setstate_seq, setstate_seq, setcheck_ignored_seq },
}; };
const struct message *seq; const struct message *seq;
unsigned int i; unsigned int i;
...@@ -550,7 +562,15 @@ static void test_button_messages(void) ...@@ -550,7 +562,15 @@ static void test_button_messages(void)
ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style); ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style);
dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code); if (button[i].style == BS_SPLITBUTTON ||
button[i].style == BS_DEFSPLITBUTTON ||
button[i].style == BS_COMMANDLINK ||
button[i].style == BS_DEFCOMMANDLINK)
{
ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08x\n", i, dlg_code);
}
else
ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code);
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd); UpdateWindow(hwnd);
...@@ -650,7 +670,11 @@ static void test_button_messages(void) ...@@ -650,7 +670,11 @@ static void test_button_messages(void)
button[i].style == BS_DEFPUSHBUTTON || button[i].style == BS_DEFPUSHBUTTON ||
button[i].style == BS_GROUPBOX || button[i].style == BS_GROUPBOX ||
button[i].style == BS_USERBUTTON || button[i].style == BS_USERBUTTON ||
button[i].style == BS_OWNERDRAW) button[i].style == BS_OWNERDRAW ||
button[i].style == BS_SPLITBUTTON ||
button[i].style == BS_DEFSPLITBUTTON ||
button[i].style == BS_COMMANDLINK ||
button[i].style == BS_DEFCOMMANDLINK)
{ {
ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE); ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE);
state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment