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
f8eb74e1
Commit
f8eb74e1
authored
Feb 11, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/button: Invalidate on BM_SETSTATE.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f1cc2da2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
button.c
dlls/comctl32/button.c
+15
-7
button.c
dlls/comctl32/tests/button.c
+3
-7
No files found.
dlls/comctl32/button.c
View file @
f8eb74e1
...
...
@@ -305,7 +305,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
POINT
pt
;
LONG
style
=
GetWindowLongW
(
hWnd
,
GWL_STYLE
);
UINT
btn_type
=
get_button_type
(
style
);
LONG
state
;
LONG
state
,
new_state
;
HANDLE
oldHbitmap
;
HTHEME
theme
;
...
...
@@ -674,12 +674,21 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case
BM_SETSTATE
:
state
=
get_button_state
(
hWnd
);
if
(
wParam
)
set_button_state
(
hWnd
,
state
|
BST_PUSHED
);
else
set_button_state
(
hWnd
,
state
&
~
BST_PUSHED
);
new_state
=
wParam
?
BST_PUSHED
:
0
;
if
((
state
^
new_state
)
&
BST_PUSHED
)
{
if
(
wParam
)
state
|=
BST_PUSHED
;
else
state
&=
~
BST_PUSHED
;
paint_button
(
hWnd
,
btn_type
,
ODA_SELECT
);
if
(
btn_type
==
BS_USERBUTTON
)
BUTTON_NOTIFY_PARENT
(
hWnd
,
(
state
&
BST_PUSHED
)
?
BN_HILITE
:
BN_UNHILITE
);
set_button_state
(
hWnd
,
state
);
InvalidateRect
(
hWnd
,
NULL
,
FALSE
);
}
break
;
case
WM_NCHITTEST
:
...
...
@@ -1206,7 +1215,6 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action )
break
;
default:
BUTTON_NOTIFY_PARENT
(
hwnd
,
BN_PAINT
);
break
;
}
}
...
...
dlls/comctl32/tests/button.c
View file @
f8eb74e1
...
...
@@ -350,8 +350,6 @@ static const struct message setstate_seq[] =
{
BM_SETSTATE
,
sent
},
{
WM_APP
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
WM_PAINT
,
sent
},
{
WM_NCPAINT
,
sent
|
optional
},
/* FIXME: Wine sends it */
{
WM_ERASEBKGND
,
sent
|
defwinproc
|
optional
},
{
WM_PAINT
,
sent
|
optional
},
{
0
}
};
...
...
@@ -372,8 +370,6 @@ static const struct message setstate_user_seq[] =
{
WM_COMMAND
,
sent
|
wparam
|
parent
,
MAKEWPARAM
(
ID_BUTTON
,
BN_HILITE
)
},
{
WM_APP
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
WM_PAINT
,
sent
},
{
WM_NCPAINT
,
sent
|
optional
},
/* FIXME: Wine sends it */
{
WM_ERASEBKGND
,
sent
|
defwinproc
|
optional
},
{
0
}
};
...
...
@@ -596,7 +592,7 @@ static void test_button_messages(void)
SendMessageA
(
hwnd
,
BM_SETSTYLE
,
button
[
i
].
style
|
BS_BOTTOM
,
TRUE
);
SendMessageA
(
hwnd
,
WM_APP
,
0
,
0
);
/* place a separator mark here */
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
todo
=
button
[
i
].
style
==
BS_
USERBUTTON
||
button
[
i
].
style
==
BS_
OWNERDRAW
;
todo
=
button
[
i
].
style
==
BS_OWNERDRAW
;
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
button
[
i
].
setstyle
,
"BM_SETSTYLE on a button"
,
todo
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
...
...
@@ -612,7 +608,7 @@ static void test_button_messages(void)
SendMessageA
(
hwnd
,
BM_SETSTATE
,
TRUE
,
0
);
SendMessageA
(
hwnd
,
WM_APP
,
0
,
0
);
/* place a separator mark here */
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
button
[
i
].
setstate
,
"BM_SETSTATE/TRUE on a button"
,
TRU
E
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
button
[
i
].
setstate
,
"BM_SETSTATE/TRUE on a button"
,
FALS
E
);
state
=
SendMessageA
(
hwnd
,
BM_GETSTATE
,
0
,
0
);
ok
(
state
==
BST_PUSHED
,
"expected state 0x0004, got %04x
\n
"
,
state
);
...
...
@@ -626,7 +622,7 @@ static void test_button_messages(void)
SendMessageA
(
hwnd
,
BM_SETSTATE
,
FALSE
,
0
);
SendMessageA
(
hwnd
,
WM_APP
,
0
,
0
);
/* place a separator mark here */
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
button
[
i
].
clearstate
,
"BM_SETSTATE/FALSE on a button"
,
TRU
E
);
ok_sequence
(
sequences
,
COMBINED_SEQ_INDEX
,
button
[
i
].
clearstate
,
"BM_SETSTATE/FALSE on a button"
,
FALS
E
);
state
=
SendMessageA
(
hwnd
,
BM_GETSTATE
,
0
,
0
);
ok
(
state
==
0
,
"expected state 0, got %04x
\n
"
,
state
);
...
...
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