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
fcd63df4
Commit
fcd63df4
authored
Nov 11, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/button: Support BS_PUSHLIKE for themed check boxes and radio buttons.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed06aa2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
button.c
dlls/comctl32/button.c
+23
-3
No files found.
dlls/comctl32/button.c
View file @
fcd63df4
...
...
@@ -393,11 +393,22 @@ static int get_draw_state(const BUTTON_INFO *infoPtr)
{
CBS_CHECKEDNORMAL
,
CBS_CHECKEDDISABLED
,
CBS_CHECKEDHOT
,
CBS_CHECKEDPRESSED
,
CBS_CHECKEDNORMAL
},
{
CBS_MIXEDNORMAL
,
CBS_MIXEDDISABLED
,
CBS_MIXEDHOT
,
CBS_MIXEDPRESSED
,
CBS_MIXEDNORMAL
}
};
static
const
int
pushlike_cb_states
[
3
][
DRAW_STATE_COUNT
]
=
{
{
PBS_NORMAL
,
PBS_DISABLED
,
PBS_HOT
,
PBS_PRESSED
,
PBS_NORMAL
},
{
PBS_PRESSED
,
PBS_PRESSED
,
PBS_HOT
,
PBS_PRESSED
,
PBS_PRESSED
},
{
PBS_NORMAL
,
PBS_DISABLED
,
PBS_HOT
,
PBS_PRESSED
,
PBS_NORMAL
}
};
static
const
int
rb_states
[
2
][
DRAW_STATE_COUNT
]
=
{
{
RBS_UNCHECKEDNORMAL
,
RBS_UNCHECKEDDISABLED
,
RBS_UNCHECKEDHOT
,
RBS_UNCHECKEDPRESSED
,
RBS_UNCHECKEDNORMAL
},
{
RBS_CHECKEDNORMAL
,
RBS_CHECKEDDISABLED
,
RBS_CHECKEDHOT
,
RBS_CHECKEDPRESSED
,
RBS_CHECKEDNORMAL
}
};
static
const
int
pushlike_rb_states
[
2
][
DRAW_STATE_COUNT
]
=
{
{
PBS_NORMAL
,
PBS_DISABLED
,
PBS_HOT
,
PBS_PRESSED
,
PBS_NORMAL
},
{
PBS_PRESSED
,
PBS_PRESSED
,
PBS_HOT
,
PBS_PRESSED
,
PBS_PRESSED
}
};
static
const
int
gb_states
[
DRAW_STATE_COUNT
]
=
{
GBS_NORMAL
,
GBS_DISABLED
,
GBS_NORMAL
,
GBS_NORMAL
,
GBS_NORMAL
};
LONG
style
=
GetWindowLongW
(
infoPtr
->
hwnd
,
GWL_STYLE
);
UINT
type
=
get_button_type
(
style
);
...
...
@@ -430,10 +441,12 @@ static int get_draw_state(const BUTTON_INFO *infoPtr)
case
BS_AUTOCHECKBOX
:
case
BS_3STATE
:
case
BS_AUTO3STATE
:
return
cb_states
[
check_state
][
state
];
return
style
&
BS_PUSHLIKE
?
pushlike_cb_states
[
check_state
][
state
]
:
cb_states
[
check_state
][
state
];
case
BS_RADIOBUTTON
:
case
BS_AUTORADIOBUTTON
:
return
rb_states
[
check_state
][
state
];
return
style
&
BS_PUSHLIKE
?
pushlike_rb_states
[
check_state
][
state
]
:
rb_states
[
check_state
][
state
];
case
BS_GROUPBOX
:
return
gb_states
[
state
];
default:
...
...
@@ -2763,8 +2776,15 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
int
text_offset
;
SIZE
box_size
;
HRGN
region
;
HRESULT
hr
;
if
(
dwStyle
&
BS_PUSHLIKE
)
{
PB_ThemedPaint
(
theme
,
infoPtr
,
hDC
,
state
,
dtFlags
,
focused
);
return
;
}
HRESULT
hr
=
GetThemeFont
(
theme
,
hDC
,
part
,
state
,
TMT_FONT
,
&
lf
);
hr
=
GetThemeFont
(
theme
,
hDC
,
part
,
state
,
TMT_FONT
,
&
lf
);
if
(
SUCCEEDED
(
hr
))
{
font
=
CreateFontIndirectW
(
&
lf
);
if
(
!
font
)
...
...
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