mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-21 17:09:06 -07:00
user32: Send parent BN_CLICKED notification when a radio button get focused.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56109
This commit is contained in:
parent
8bcc754e11
commit
a2225cc881
2 changed files with 10 additions and 4 deletions
|
@ -257,8 +257,8 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
NtUserSetCapture( hWnd );
|
NtUserSetCapture( hWnd );
|
||||||
NtUserSetFocus( hWnd );
|
|
||||||
set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED );
|
set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED );
|
||||||
|
NtUserSetFocus( hWnd );
|
||||||
SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 );
|
SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -381,6 +381,12 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||||
paint_button( hWnd, btn_type, ODA_FOCUS );
|
paint_button( hWnd, btn_type, ODA_FOCUS );
|
||||||
if (style & BS_NOTIFY)
|
if (style & BS_NOTIFY)
|
||||||
BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS);
|
BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS);
|
||||||
|
|
||||||
|
if (((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON)) &&
|
||||||
|
!(get_button_state(hWnd) & (BST_CHECKED | BUTTON_BTNPRESSED)))
|
||||||
|
{
|
||||||
|
BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
|
|
|
@ -20576,7 +20576,7 @@ static void test_radiobutton_focus(void)
|
||||||
flush_sequence();
|
flush_sequence();
|
||||||
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
||||||
flush_events();
|
flush_events();
|
||||||
ok_sequence(set_focus_default_seq, "WM_SETFOCUS on default radiobutton", TRUE);
|
ok_sequence(set_focus_default_seq, "WM_SETFOCUS on default radiobutton", FALSE);
|
||||||
DestroyWindow(button);
|
DestroyWindow(button);
|
||||||
|
|
||||||
/* Test already checked button */
|
/* Test already checked button */
|
||||||
|
@ -20597,7 +20597,7 @@ static void test_radiobutton_focus(void)
|
||||||
flush_sequence();
|
flush_sequence();
|
||||||
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
||||||
flush_events();
|
flush_events();
|
||||||
ok_sequence(set_focus_default_seq, "WM_SETFOCUS on focused radiobutton", TRUE);
|
ok_sequence(set_focus_default_seq, "WM_SETFOCUS on focused radiobutton", FALSE);
|
||||||
DestroyWindow(button);
|
DestroyWindow(button);
|
||||||
|
|
||||||
/* Test WM_LBUTTONDOWN */
|
/* Test WM_LBUTTONDOWN */
|
||||||
|
@ -20616,7 +20616,7 @@ static void test_radiobutton_focus(void)
|
||||||
flush_sequence();
|
flush_sequence();
|
||||||
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
SendMessageA(button, WM_SETFOCUS, 0, 0);
|
||||||
flush_events();
|
flush_events();
|
||||||
ok_sequence(set_focus_without_notify_seq, "WM_SETFOCUS on radiobutton withouth BS_NOTIFY", TRUE);
|
ok_sequence(set_focus_without_notify_seq, "WM_SETFOCUS on radiobutton withouth BS_NOTIFY", FALSE);
|
||||||
DestroyWindow(button);
|
DestroyWindow(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue