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
00ea0868
Commit
00ea0868
authored
Oct 11, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename GetItemHeight to CalculateMaxHeight, for consistency
Fix usage of nItemWidth vs. iconSpacing.cx Misc cleanups.
parent
a1ca0122
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
26 deletions
+21
-26
listview.c
dlls/comctl32/listview.c
+21
-26
No files found.
dlls/comctl32/listview.c
View file @
00ea0868
...
...
@@ -275,7 +275,7 @@ static BOOL LISTVIEW_GetItemBox(LISTVIEW_INFO *, INT, LPRECT);
static
void
LISTVIEW_AlignLeft
(
LISTVIEW_INFO
*
);
static
void
LISTVIEW_AlignTop
(
LISTVIEW_INFO
*
);
static
void
LISTVIEW_AddGroupSelection
(
LISTVIEW_INFO
*
,
INT
);
static
INT
LISTVIEW_
GetItem
Height
(
LISTVIEW_INFO
*
);
static
INT
LISTVIEW_
CalculateMax
Height
(
LISTVIEW_INFO
*
);
static
BOOL
LISTVIEW_GetItemListOrigin
(
LISTVIEW_INFO
*
,
INT
,
LPPOINT
);
static
BOOL
LISTVIEW_GetItemPosition
(
LISTVIEW_INFO
*
,
INT
,
LPPOINT
);
static
BOOL
LISTVIEW_GetItemRect
(
LISTVIEW_INFO
*
,
INT
,
LPRECT
);
...
...
@@ -1440,7 +1440,7 @@ static BOOL LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem,
{
State
.
left
=
Box
.
left
-
infoPtr
->
iconStateSize
.
cx
-
2
;
if
(
infoPtr
->
himlNormal
)
State
.
left
+=
(
infoPtr
->
iconSpacing
.
cx
-
infoPtr
->
iconSize
.
cx
)
/
2
+
ICON_LR_HALF
;
State
.
left
+=
(
infoPtr
->
nItemWidth
-
infoPtr
->
iconSize
.
cx
)
/
2
;
State
.
top
=
Box
.
top
+
infoPtr
->
iconSize
.
cy
-
infoPtr
->
iconStateSize
.
cy
+
4
;
}
else
...
...
@@ -1471,7 +1471,7 @@ static BOOL LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem,
{
Icon
.
left
=
Box
.
left
;
if
(
infoPtr
->
himlNormal
)
Icon
.
left
+=
(
infoPtr
->
iconSpacing
.
cx
-
infoPtr
->
iconSize
.
cx
)
/
2
;
Icon
.
left
+=
(
infoPtr
->
nItemWidth
-
infoPtr
->
iconSize
.
cx
)
/
2
;
Icon
.
top
=
Box
.
top
+
ICON_TOP_PADDING
;
Icon
.
right
=
Icon
.
left
;
Icon
.
bottom
=
Icon
.
top
;
...
...
@@ -1542,7 +1542,7 @@ static BOOL LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem,
calc_label:
if
(
uView
==
LVS_ICON
)
{
Label
.
left
=
Box
.
left
+
(
infoPtr
->
iconSpacing
.
cx
-
labelSize
.
cx
)
/
2
;
Label
.
left
=
Box
.
left
+
(
infoPtr
->
nItemWidth
-
labelSize
.
cx
)
/
2
;
Label
.
top
=
Box
.
top
+
ICON_TOP_PADDING_HITABLE
+
infoPtr
->
iconSize
.
cy
+
ICON_BOTTOM_PADDING
;
Label
.
right
=
Label
.
left
+
labelSize
.
cx
;
...
...
@@ -1951,7 +1951,7 @@ static void LISTVIEW_SaveTextMetrics(LISTVIEW_INFO *infoPtr)
* RETURN:
* Returns item height.
*/
static
INT
LISTVIEW_
GetItem
Height
(
LISTVIEW_INFO
*
infoPtr
)
static
INT
LISTVIEW_
CalculateMax
Height
(
LISTVIEW_INFO
*
infoPtr
)
{
INT
nItemHeight
;
...
...
@@ -4832,7 +4832,7 @@ static BOOL LISTVIEW_GetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT
if
(
uView
==
LVS_ICON
)
{
lpptPosition
->
x
+=
(
infoPtr
->
iconSpacing
.
cx
-
infoPtr
->
iconSize
.
cx
)
/
2
;
lpptPosition
->
x
+=
(
infoPtr
->
nItemWidth
-
infoPtr
->
iconSize
.
cx
)
/
2
;
lpptPosition
->
y
+=
ICON_TOP_PADDING
;
}
lpptPosition
->
x
+=
Origin
.
x
;
...
...
@@ -6120,25 +6120,20 @@ static LRESULT LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT iCol, INT cx)
LVITEMW
lvItem
;
WCHAR
szDispText
[
DISP_TEXT_SIZE
]
=
{
0
};
if
(
!
infoPtr
->
hwndHeader
)
/* make sure we have a header */
return
(
FALSE
);
TRACE
(
"(iCol=%d, cx=%d
\n
"
,
iCol
,
cx
);
/* set column width only if in report or list mode */
if
((
uView
!=
LVS_REPORT
)
&&
(
uView
!=
LVS_LIST
))
return
(
FALSE
);
TRACE
(
"(iCol=%d, cx=%d
\n
"
,
iCol
,
cx
);
if
(
uView
!=
LVS_REPORT
&&
uView
!=
LVS_LIST
)
return
FALSE
;
/* take care of invalid cx values */
if
((
uView
==
LVS_REPORT
)
&&
(
cx
<
-
2
))
cx
=
LVSCW_AUTOSIZE
;
else
if
(
uView
==
LVS_LIST
&&
(
cx
<
1
))
return
FALSE
;
if
(
uView
==
LVS_REPORT
&&
cx
<
-
2
)
cx
=
LVSCW_AUTOSIZE
;
else
if
(
uView
==
LVS_LIST
&&
cx
<
1
)
return
FALSE
;
/* resize all columns if in LVS_LIST mode */
if
(
uView
==
LVS_LIST
)
{
if
(
uView
==
LVS_LIST
)
{
infoPtr
->
nItemWidth
=
cx
;
LISTVIEW_InvalidateList
(
infoPtr
);
/* FIXME: optimize */
LISTVIEW_InvalidateList
(
infoPtr
);
return
TRUE
;
}
...
...
@@ -6386,7 +6381,7 @@ static LRESULT LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, DWORD spacing)
/* these depend on the iconSpacing */
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
return
oldspacing
;
}
...
...
@@ -6450,7 +6445,7 @@ static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *infoPtr, INT nType, HIMAG
return
NULL
;
}
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
if
(
infoPtr
->
nItemHeight
!=
oldHeight
)
LISTVIEW_UpdateScroll
(
infoPtr
);
...
...
@@ -6545,7 +6540,7 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, POINT pt
LISTVIEW_GetOrigin
(
infoPtr
,
&
pt
);
else
if
(
uView
==
LVS_ICON
)
{
pt
.
x
-=
(
infoPtr
->
iconSpacing
.
cx
-
infoPtr
->
iconSize
.
cx
)
/
2
;
pt
.
x
-=
(
infoPtr
->
nItemWidth
-
infoPtr
->
iconSize
.
cx
)
/
2
;
pt
.
y
-=
ICON_TOP_PADDING
;
}
...
...
@@ -6954,7 +6949,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
/* initialize size of items */
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
/* initialize the hover time to -1(indicating the default system hover time) */
infoPtr
->
dwHoverTime
=
-
1
;
...
...
@@ -8122,7 +8117,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
/* Now update the full item width and height */
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
if
(
lpss
->
styleNew
&
LVS_ALIGNLEFT
)
LISTVIEW_AlignLeft
(
infoPtr
);
else
...
...
@@ -8144,21 +8139,21 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
infoPtr
->
iconSize
.
cx
=
GetSystemMetrics
(
SM_CXSMICON
);
infoPtr
->
iconSize
.
cy
=
GetSystemMetrics
(
SM_CYSMICON
);
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
}
else
if
(
uNewView
==
LVS_LIST
)
{
infoPtr
->
iconSize
.
cx
=
GetSystemMetrics
(
SM_CXSMICON
);
infoPtr
->
iconSize
.
cy
=
GetSystemMetrics
(
SM_CYSMICON
);
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
}
else
{
infoPtr
->
iconSize
.
cx
=
GetSystemMetrics
(
SM_CXSMICON
);
infoPtr
->
iconSize
.
cy
=
GetSystemMetrics
(
SM_CYSMICON
);
infoPtr
->
nItemWidth
=
LISTVIEW_CalculateMaxWidth
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
GetItem
Height
(
infoPtr
);
infoPtr
->
nItemHeight
=
LISTVIEW_
CalculateMax
Height
(
infoPtr
);
if
(
lpss
->
styleNew
&
LVS_ALIGNLEFT
)
LISTVIEW_AlignLeft
(
infoPtr
);
else
...
...
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