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
0613b721
Commit
0613b721
authored
Oct 19, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 19, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the entire format bitmap in the column info.
Rewrite GetColumnT to take advantage of that. Related cleanups, and simplifications.
parent
569de038
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
70 deletions
+30
-70
listview.c
dlls/comctl32/listview.c
+30
-70
No files found.
dlls/comctl32/listview.c
View file @
0613b721
...
...
@@ -79,8 +79,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(listview);
typedef
struct
tagCOLUMN_INFO
{
RECT
rcHeader
;
/* tracks the header's rectangle */
UINT
align
;
/* one of DT_{LEFT,CENTER,RIGHT} */
BOOL
hasImage
;
/* on/off switch for column images */
int
fmt
;
/* same as LVCOLUMN.fmt */
}
COLUMN_INFO
;
typedef
struct
tagITEMHDR
...
...
@@ -303,7 +302,6 @@ static LRESULT LISTVIEW_GetStringWidthT(LISTVIEW_INFO *, LPCWSTR, BOOL);
static
BOOL
LISTVIEW_KeySelection
(
LISTVIEW_INFO
*
,
INT
);
static
LRESULT
LISTVIEW_GetItemState
(
LISTVIEW_INFO
*
,
INT
,
UINT
);
static
LRESULT
LISTVIEW_SetItemState
(
LISTVIEW_INFO
*
,
INT
,
LPLVITEMW
);
static
LRESULT
LISTVIEW_GetColumnT
(
LISTVIEW_INFO
*
,
INT
,
LPLVCOLUMNW
,
BOOL
);
static
LRESULT
LISTVIEW_VScroll
(
LISTVIEW_INFO
*
,
INT
,
INT
,
HWND
);
static
LRESULT
LISTVIEW_HScroll
(
LISTVIEW_INFO
*
,
INT
,
INT
,
HWND
);
static
INT
LISTVIEW_GetTopIndex
(
LISTVIEW_INFO
*
);
...
...
@@ -1734,7 +1732,7 @@ static BOOL LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem,
if
(
!
IsRectEmpty
(
&
State
))
Icon
.
left
+=
IMAGE_PADDING
;
Icon
.
top
=
Box
.
top
;
Icon
.
right
=
Icon
.
left
;
if
(
infoPtr
->
himlSmall
&&
(
!
lpColumnInfo
||
lp
ColumnInfo
->
hasImage
))
if
(
infoPtr
->
himlSmall
&&
(
!
lpColumnInfo
||
lp
LVItem
->
iSubItem
==
0
||
(
lpColumnInfo
->
fmt
&
LVCFMT_IMAGE
)))
Icon
.
right
+=
infoPtr
->
iconSize
.
cx
;
Icon
.
bottom
=
Icon
.
top
+
infoPtr
->
nItemHeight
;
}
...
...
@@ -3386,7 +3384,12 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
else
if
(
nSubItem
)
{
COLUMN_INFO
*
lpColumnInfo
=
DPA_GetPtr
(
infoPtr
->
hdpaColumns
,
nSubItem
);
if
(
lpColumnInfo
)
uFormat
|=
lpColumnInfo
->
align
;
if
(
lpColumnInfo
)
{
if
(
lpColumnInfo
->
fmt
&
LVCFMT_LEFT
)
uFormat
|=
DT_LEFT
;
else
if
(
lpColumnInfo
->
fmt
&
LVCFMT_RIGHT
)
uFormat
|=
DT_RIGHT
;
else
if
(
lpColumnInfo
->
fmt
&
LVCFMT_CENTER
)
uFormat
|=
DT_CENTER
;
}
}
if
(
!
(
uFormat
&
(
DT_RIGHT
|
DT_CENTER
)))
rcLabel
.
left
+=
2
;
DrawTextW
(
hdc
,
lvItem
.
pszText
,
-
1
,
&
rcLabel
,
uFormat
);
...
...
@@ -4471,7 +4474,7 @@ static LRESULT LISTVIEW_FindItemA(LISTVIEW_INFO *infoPtr, INT nStart,
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
* [I] n
Item
: column index
* [I] n
Column
: column index
* [IO] lpColumn : column information
* [I] isW : if TRUE, then lpColumn is a LPLVCOLUMNW
* otherwise it is in fact a LPLVCOLUMNA
...
...
@@ -4480,77 +4483,45 @@ static LRESULT LISTVIEW_FindItemA(LISTVIEW_INFO *infoPtr, INT nStart,
* SUCCESS : TRUE
* FAILURE : FALSE
*/
static
LRESULT
LISTVIEW_GetColumnT
(
LISTVIEW_INFO
*
infoPtr
,
INT
n
Item
,
LPLVCOLUMNW
lpColumn
,
BOOL
isW
)
static
LRESULT
LISTVIEW_GetColumnT
(
LISTVIEW_INFO
*
infoPtr
,
INT
n
Column
,
LPLVCOLUMNW
lpColumn
,
BOOL
isW
)
{
HDITEMW
hdi
;
BOOL
bResult
=
FALSE
;
COLUMN_INFO
*
lpColumnInfo
;
HDITEMW
hdi
;
if
(
lpColumn
!=
NULL
)
{
if
(
!
lpColumn
||
nColumn
<
0
||
nColumn
>=
infoPtr
->
hdpaColumns
->
nItemCount
)
return
FALSE
;
if
(
!
(
lpColumnInfo
=
DPA_GetPtr
(
infoPtr
->
hdpaColumns
,
nColumn
)))
return
FALSE
;
/* initialize memory */
ZeroMemory
(
&
hdi
,
sizeof
(
hdi
));
if
(
lpColumn
->
mask
&
LVCF_FMT
)
hdi
.
mask
|=
HDI_FORMAT
;
if
(
lpColumn
->
mask
&
LVCF_WIDTH
)
hdi
.
mask
|=
HDI_WIDTH
;
if
(
lpColumn
->
mask
&
LVCF_TEXT
)
{
hdi
.
mask
|=
HDI_TEXT
;
hdi
.
cchTextMax
=
lpColumn
->
cchTextMax
;
hdi
.
pszText
=
lpColumn
->
pszText
;
hdi
.
mask
|=
HDI_TEXT
;
hdi
.
pszText
=
lpColumn
->
pszText
;
hdi
.
cchTextMax
=
lpColumn
->
cchTextMax
;
}
if
(
lpColumn
->
mask
&
LVCF_IMAGE
)
hdi
.
mask
|=
HDI_IMAGE
;
hdi
.
mask
|=
HDI_IMAGE
;
if
(
lpColumn
->
mask
&
LVCF_ORDER
)
hdi
.
mask
|=
HDI_ORDER
;
if
(
isW
)
bResult
=
Header_GetItemW
(
infoPtr
->
hwndHeader
,
nItem
,
&
hdi
);
else
bResult
=
Header_GetItemA
(
infoPtr
->
hwndHeader
,
nItem
,
&
hdi
);
if
(
bResult
)
{
if
(
lpColumn
->
mask
&
LVCF_FMT
)
{
lpColumn
->
fmt
=
0
;
if
(
hdi
.
fmt
&
HDF_LEFT
)
lpColumn
->
fmt
|=
LVCFMT_LEFT
;
else
if
(
hdi
.
fmt
&
HDF_RIGHT
)
lpColumn
->
fmt
|=
LVCFMT_RIGHT
;
else
if
(
hdi
.
fmt
&
HDF_CENTER
)
lpColumn
->
fmt
|=
LVCFMT_CENTER
;
hdi
.
mask
|=
HDI_ORDER
;
if
(
hdi
.
fmt
&
HDF_IMAGE
)
lpColumn
->
fmt
|=
LVCFMT_COL_HAS_IMAGES
;
if
(
!
SendMessageW
(
infoPtr
->
hwndHeader
,
isW
?
HDM_GETITEMW
:
HDM_GETITEMA
,
nColumn
,
(
LPARAM
)
&
hdi
))
return
FALSE
;
if
(
hdi
.
fmt
&
HDF_BITMAP_ON_RIGHT
)
lpColumn
->
fmt
|=
LVCFMT_BITMAP_ON_RIGHT
;
}
if
(
lpColumn
->
mask
&
LVCF_WIDTH
)
lpColumn
->
cx
=
hdi
.
cxy
;
if
(
lpColumn
->
mask
&
LVCF_IMAGE
)
lpColumn
->
iImage
=
hdi
.
iImage
;
if
(
lpColumn
->
mask
&
LVCF_FMT
)
lpColumn
->
fmt
=
lpColumnInfo
->
fmt
;
if
(
lpColumn
->
mask
&
LVCF_ORDER
)
lpColumn
->
iOrder
=
hdi
.
iOrder
;
if
(
lpColumn
->
mask
&
LVCF_WIDTH
)
lpColumn
->
cx
=
lpColumnInfo
->
rcHeader
.
right
-
lpColumnInfo
->
rcHeader
.
left
;
TRACE
(
"(col=%d, lpColumn=%s, isW=%d)
\n
"
,
nItem
,
debuglvcolumn_t
(
lpColumn
,
isW
),
isW
)
;
if
(
lpColumn
->
mask
&
LVCF_IMAGE
)
lpColumn
->
iImage
=
hdi
.
iImage
;
}
}
if
(
lpColumn
->
mask
&
LVCF_ORDER
)
lpColumn
->
iOrder
=
hdi
.
iOrder
;
return
bResult
;
return
TRUE
;
}
...
...
@@ -5961,18 +5932,7 @@ static BOOL column_fill_info(LISTVIEW_INFO *infoPtr, COLUMN_INFO *lpColumnInfo,
if
(
!
Header_GetItemRect
(
infoPtr
->
hwndHeader
,
nColumn
,
&
rcCol
))
return
FALSE
;
lpColumnInfo
->
rcHeader
=
rcCol
;
if
(
lpColumn
->
mask
&
LVCF_FMT
)
{
if
(
nColumn
==
0
||
lpColumn
->
fmt
&
LVCFMT_LEFT
)
lpColumnInfo
->
align
=
DT_LEFT
;
else
if
(
lpColumn
->
fmt
&
LVCFMT_RIGHT
)
lpColumnInfo
->
align
=
DT_RIGHT
;
else
if
(
lpColumn
->
fmt
&
LVCFMT_CENTER
)
lpColumnInfo
->
align
=
DT_CENTER
;
if
(
nColumn
==
0
||
(
lpColumn
->
fmt
&
LVCFMT_IMAGE
))
lpColumnInfo
->
hasImage
=
TRUE
;
}
else
{
lpColumnInfo
->
align
=
DT_LEFT
;
lpColumnInfo
->
hasImage
=
(
nColumn
==
0
);
}
lpColumnInfo
->
fmt
=
lpColumn
->
fmt
;
return
TRUE
;
}
...
...
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