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
764607d9
Commit
764607d9
authored
Oct 10, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix large item label calculation when not focused.
Fancy focus rectangle handling.
parent
b2056c22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
36 deletions
+34
-36
listview.c
dlls/comctl32/listview.c
+34
-36
No files found.
dlls/comctl32/listview.c
View file @
764607d9
...
...
@@ -262,6 +262,7 @@ DEFINE_COMMON_NOTIFICATIONS(LISTVIEW_INFO, hwndSelf);
*/
static
BOOL
LISTVIEW_GetItemT
(
LISTVIEW_INFO
*
,
LPLVITEMW
,
BOOL
);
static
INT
LISTVIEW_SuperHitTestItem
(
LISTVIEW_INFO
*
,
LPLVHITTESTINFO
,
BOOL
,
BOOL
);
static
BOOL
LISTVIEW_GetItemMeasures
(
LISTVIEW_INFO
*
,
INT
,
LPRECT
,
LPRECT
,
LPRECT
,
LPRECT
);
static
void
LISTVIEW_AlignLeft
(
LISTVIEW_INFO
*
);
static
void
LISTVIEW_AlignTop
(
LISTVIEW_INFO
*
);
static
void
LISTVIEW_AddGroupSelection
(
LISTVIEW_INFO
*
,
INT
);
...
...
@@ -1142,67 +1143,57 @@ static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr)
*/
static
void
LISTVIEW_ShowFocusRect
(
LISTVIEW_INFO
*
infoPtr
,
BOOL
fShow
)
{
RECT
rcItem
;
INT
nItem
=
infoPtr
->
nFocusedItem
;
HDC
hdc
;
TRACE
(
"fShow=%d, nItem=%d
\n
"
,
fShow
,
n
Item
);
TRACE
(
"fShow=%d, nItem=%d
\n
"
,
fShow
,
infoPtr
->
nFocused
Item
);
if
(
nItem
<
0
||
nItem
>=
infoPtr
->
nItemCount
)
return
;
if
(
infoPtr
->
nFocusedItem
<
0
)
return
;
rcItem
.
left
=
LVIR_BOUNDS
;
rcItem
.
top
=
0
;
if
(
(
infoPtr
->
dwStyle
&
LVS_TYPEMASK
)
==
LVS_REPORT
&&
!
(
infoPtr
->
dwLvExStyle
&
LVS_EX_FULLROWSELECT
)
&&
!
(
infoPtr
->
dwStyle
&
LVS_OWNERDRAWFIXED
))
/* we need some gymnastics in ICON mode to handle large items */
if
(
(
infoPtr
->
dwStyle
&
LVS_TYPEMASK
)
==
LVS_ICON
)
{
/* this little optimization eliminates some nasty flicker */
if
(
!
LISTVIEW_GetSubItemRect
(
infoPtr
,
nItem
,
&
rcItem
))
return
;
}
else
{
if
(
!
LISTVIEW_GetItemRect
(
infoPtr
,
nItem
,
&
rcItem
))
return
;
RECT
rcBox
;
if
(
!
LISTVIEW_GetItemMeasures
(
infoPtr
,
infoPtr
->
nFocusedItem
,
&
rcBox
,
0
,
0
,
0
))
return
;
if
((
rcBox
.
bottom
-
rcBox
.
top
)
>
infoPtr
->
nItemHeight
)
{
LISTVIEW_InvalidateRect
(
infoPtr
,
&
rcBox
);
return
;
}
}
if
(
!
(
hdc
=
GetDC
(
infoPtr
->
hwndSelf
)))
return
;
if
(
infoPtr
->
dwStyle
&
LVS_OWNERDRAWFIXED
)
{
DRAWITEMSTRUCT
dis
;
LVITEMW
item
;
HDC
hdc
;
item
.
iItem
=
n
Item
;
item
.
iItem
=
infoPtr
->
nFocused
Item
;
item
.
iSubItem
=
0
;
item
.
mask
=
LVIF_PARAM
;
if
(
!
LISTVIEW_GetItemW
(
infoPtr
,
&
item
))
goto
invalidat
e
;
if
(
!
LISTVIEW_GetItemW
(
infoPtr
,
&
item
))
goto
don
e
;
if
(
!
(
hdc
=
GetDC
(
infoPtr
->
hwndSelf
)))
goto
invalidate
;
ZeroMemory
(
&
dis
,
sizeof
(
dis
));
dis
.
CtlType
=
ODT_LISTVIEW
;
dis
.
CtlID
=
GetWindowLongW
(
infoPtr
->
hwndSelf
,
GWL_ID
);
dis
.
itemID
=
n
Item
;
dis
.
itemID
=
item
.
i
Item
;
dis
.
itemAction
=
ODA_FOCUS
;
if
(
fShow
)
dis
.
itemState
|=
ODS_FOCUS
;
dis
.
hwndItem
=
infoPtr
->
hwndSelf
;
dis
.
hDC
=
hdc
;
dis
.
rcItem
=
rcItem
;
if
(
!
LISTVIEW_GetItemMeasures
(
infoPtr
,
dis
.
itemID
,
&
dis
.
rcItem
,
0
,
0
,
0
))
goto
done
;
dis
.
itemData
=
item
.
lParam
;
SendMessageW
(
GetParent
(
infoPtr
->
hwndSelf
),
WM_DRAWITEM
,
dis
.
CtlID
,
(
LPARAM
)
&
dis
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hdc
);
return
;
}
else
{
/* Here we are inneficient. We could, in theory, simply DrawFocusRect
* to erase/show the focus, without all this heavy duty redraw.
* Note that there are cases where we can not do that: when the list
* is in ICON mode, and the item is large, we must to invalidate it.
* Moreover, in the vast majority of cases, the selection status of
* the item changes anyway, and so the item is invalidated already,
* so not too much harm is done. If we do notice any flicker, we should
* refine this method. */
invalidate:
LISTVIEW_InvalidateRect
(
infoPtr
,
&
rcItem
);
DrawFocusRect
(
hdc
,
&
infoPtr
->
rcFocus
);
}
done:
ReleaseDC
(
infoPtr
->
hwndSelf
,
hdc
);
}
/***
...
...
@@ -1451,8 +1442,6 @@ static BOOL LISTVIEW_GetItemMeasures(LISTVIEW_INFO *infoPtr, INT nItem,
if
(
uView
==
LVS_ICON
)
{
if
(
!
oversizedBox
&&
labelSize
.
cy
>
infoPtr
->
ntmHeight
)
labelSize
.
cy
=
(
labelSize
.
cy
/
infoPtr
->
ntmHeight
)
*
infoPtr
->
ntmHeight
;
Label
.
left
=
Box
.
left
+
(
infoPtr
->
iconSpacing
.
cx
-
labelSize
.
cx
)
/
2
;
Label
.
top
=
Box
.
top
+
ICON_TOP_PADDING_HITABLE
+
infoPtr
->
iconSize
.
cy
+
ICON_BOTTOM_PADDING
;
...
...
@@ -1460,7 +1449,16 @@ static BOOL LISTVIEW_GetItemMeasures(LISTVIEW_INFO *infoPtr, INT nItem,
if
(
infoPtr
->
dwStyle
&
LVS_OWNERDRAWFIXED
)
Label
.
bottom
=
Label
.
top
+
infoPtr
->
nItemHeight
;
else
{
if
(
!
oversizedBox
&&
labelSize
.
cy
>
infoPtr
->
ntmHeight
)
{
labelSize
.
cy
=
min
(
Box
.
bottom
-
Label
.
top
,
labelSize
.
cy
);
labelSize
.
cy
/=
infoPtr
->
ntmHeight
;
labelSize
.
cy
=
max
(
labelSize
.
cy
,
1
);
labelSize
.
cy
*=
infoPtr
->
ntmHeight
;
}
Label
.
bottom
=
Label
.
top
+
labelSize
.
cy
+
HEIGHT_PADDING
;
}
}
else
/* LVS_SMALLICON, LVS_LIST or LVS_REPORT */
{
...
...
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