Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e898c53f
Commit
e898c53f
authored
Oct 26, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 26, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make button return exactly the same dialog codes as Windows does.
Add a test case.
parent
217bd082
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
button.c
dlls/user/button.c
+5
-6
msg.c
dlls/user/tests/msg.c
+28
-12
No files found.
dlls/user/button.c
View file @
e898c53f
...
...
@@ -224,13 +224,12 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
case
WM_GETDLGCODE
:
switch
(
btn_type
)
{
case
BS_AUTOCHECKBOX
:
return
DLGC_BUTTON
|
DLGC_WANTCHARS
;
case
BS_AUTORADIOBUTTON
:
return
DLGC_RADIOBUTTON
;
case
BS_CHECKBOX
:
return
DLGC_BUTTON
|
DLGC_WANTCHARS
;
case
BS_DEFPUSHBUTTON
:
return
DLGC_DEFPUSHBUTTON
;
case
BS_USERBUTTON
:
case
BS_PUSHBUTTON
:
return
DLGC_BUTTON
|
DLGC_UNDEFPUSHBUTTON
;
case
BS_DEFPUSHBUTTON
:
return
DLGC_BUTTON
|
DLGC_DEFPUSHBUTTON
;
case
BS_RADIOBUTTON
:
case
BS_AUTORADIOBUTTON
:
return
DLGC_BUTTON
|
DLGC_RADIOBUTTON
;
case
BS_GROUPBOX
:
return
DLGC_STATIC
;
case
BS_PUSHBUTTON
:
return
DLGC_UNDEFPUSHBUTTON
;
case
BS_RADIOBUTTON
:
return
DLGC_RADIOBUTTON
;
default:
return
DLGC_BUTTON
;
}
...
...
dlls/user/tests/msg.c
View file @
e898c53f
...
...
@@ -2643,23 +2643,36 @@ static void test_button_messages(void)
static
const
struct
{
DWORD
style
;
DWORD
dlg_code
;
const
struct
message
*
setfocus
;
const
struct
message
*
killfocus
;
}
button
[]
=
{
{
BS_PUSHBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_DEFPUSHBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_CHECKBOX
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_AUTOCHECKBOX
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_RADIOBUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_3STATE
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_AUTO3STATE
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_GROUPBOX
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_USERBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_AUTORADIOBUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_OWNERDRAW
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
}
{
BS_PUSHBUTTON
,
DLGC_BUTTON
|
DLGC_UNDEFPUSHBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_DEFPUSHBUTTON
,
DLGC_BUTTON
|
DLGC_DEFPUSHBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_CHECKBOX
,
DLGC_BUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_AUTOCHECKBOX
,
DLGC_BUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_RADIOBUTTON
,
DLGC_BUTTON
|
DLGC_RADIOBUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_3STATE
,
DLGC_BUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_AUTO3STATE
,
DLGC_BUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_GROUPBOX
,
DLGC_STATIC
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_USERBUTTON
,
DLGC_BUTTON
|
DLGC_UNDEFPUSHBUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
},
{
BS_AUTORADIOBUTTON
,
DLGC_BUTTON
|
DLGC_RADIOBUTTON
,
WmSetFocusStaticSeq
,
WmKillFocusStaticSeq
},
{
BS_OWNERDRAW
,
DLGC_BUTTON
,
WmSetFocusButtonSeq
,
WmKillFocusButtonSeq
}
};
unsigned
int
i
;
HWND
hwnd
;
DWORD
dlg_code
;
subclass_button
();
...
...
@@ -2669,6 +2682,9 @@ static void test_button_messages(void)
0
,
0
,
50
,
14
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"Failed to create button window
\n
"
);
dlg_code
=
SendMessageA
(
hwnd
,
WM_GETDLGCODE
,
0
,
0
);
ok
(
dlg_code
==
button
[
i
].
dlg_code
,
"%d: wrong dlg_code %08lx
\n
"
,
i
,
dlg_code
);
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
SetFocus
(
0
);
...
...
@@ -2684,7 +2700,7 @@ static void test_button_messages(void)
DestroyWindow
(
hwnd
);
}
hwnd
=
CreateWindowExA
(
0
,
"my_button_class"
,
"test"
,
button
[
i
].
style
|
WS_POPUP
|
WS_VISIBLE
,
hwnd
=
CreateWindowExA
(
0
,
"my_button_class"
,
"test"
,
BS_PUSHBUTTON
|
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
50
,
14
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"Failed to create button window
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment