Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a27db516
Commit
a27db516
authored
Nov 23, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listbox: Use helper to test for selected state on painting.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54ee4db6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
listbox.c
dlls/comctl32/listbox.c
+11
-4
No files found.
dlls/comctl32/listbox.c
View file @
a27db516
...
...
@@ -491,7 +491,13 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
INT
index
,
UINT
action
,
BOOL
ignoreFocus
)
{
LB_ITEMDATA
*
item
=
NULL
;
if
(
index
<
descr
->
nb_items
)
item
=
&
descr
->
items
[
index
];
BOOL
selected
=
FALSE
;
if
(
index
<
descr
->
nb_items
)
{
item
=
&
descr
->
items
[
index
];
selected
=
is_item_selected
(
descr
,
index
);
}
if
(
IS_OWNERDRAW
(
descr
))
{
...
...
@@ -522,7 +528,8 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
dis
.
hDC
=
hdc
;
dis
.
itemID
=
index
;
dis
.
itemState
=
0
;
if
(
item
->
selected
)
dis
.
itemState
|=
ODS_SELECTED
;
if
(
selected
)
dis
.
itemState
|=
ODS_SELECTED
;
if
(
!
ignoreFocus
&&
(
descr
->
focus_item
==
index
)
&&
(
descr
->
caret_on
)
&&
(
descr
->
in_focus
))
dis
.
itemState
|=
ODS_FOCUS
;
...
...
@@ -545,7 +552,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
DrawFocusRect
(
hdc
,
rect
);
return
;
}
if
(
item
&&
item
->
selected
)
if
(
selected
)
{
oldBk
=
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHT
)
);
oldText
=
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHTTEXT
));
...
...
@@ -570,7 +577,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
item
->
str
,
strlenW
(
item
->
str
),
descr
->
nb_tabs
,
descr
->
tabs
,
0
);
}
if
(
item
&&
item
->
selected
)
if
(
selected
)
{
SetBkColor
(
hdc
,
oldBk
);
SetTextColor
(
hdc
,
oldText
);
...
...
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