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
dd3fc178
Commit
dd3fc178
authored
Apr 22, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Add callback subitem on column insertion.
parent
860329d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
24 deletions
+61
-24
listview.c
dlls/comctl32/listview.c
+18
-8
listview.c
dlls/comctl32/tests/listview.c
+43
-16
No files found.
dlls/comctl32/listview.c
View file @
dd3fc178
...
...
@@ -4276,12 +4276,11 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
*
bChanged
=
TRUE
;
}
if
(
lpLVItem
->
mask
&
LVIF_IMAGE
)
if
(
lpSubItem
->
hdr
.
iImage
!=
lpLVItem
->
iImage
)
{
lpSubItem
->
hdr
.
iImage
=
lpLVItem
->
iImage
;
*
bChanged
=
TRUE
;
}
if
((
lpLVItem
->
mask
&
LVIF_IMAGE
)
&&
(
lpSubItem
->
hdr
.
iImage
!=
lpLVItem
->
iImage
))
{
lpSubItem
->
hdr
.
iImage
=
lpLVItem
->
iImage
;
*
bChanged
=
TRUE
;
}
if
((
lpLVItem
->
mask
&
LVIF_TEXT
)
&&
textcmpWT
(
lpSubItem
->
hdr
.
pszText
,
lpLVItem
->
pszText
,
isW
))
{
...
...
@@ -6434,7 +6433,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
if
(
isubitem
)
{
SUBITEM_INFO
*
lpSubItem
=
LISTVIEW_GetSubItemPtr
(
hdpaSubItems
,
isubitem
);
SUBITEM_INFO
*
lpSubItem
=
LISTVIEW_GetSubItemPtr
(
hdpaSubItems
,
isubitem
);
pItemHdr
=
lpSubItem
?
&
lpSubItem
->
hdr
:
&
callbackHdr
;
if
(
!
lpSubItem
)
{
...
...
@@ -7883,7 +7882,14 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
SUBITEM_INFO
*
lpSubItem
;
HDPA
hdpaSubItems
;
INT
nItem
,
i
;
LVITEMW
item
;
BOOL
changed
;
item
.
iSubItem
=
nNewColumn
;
item
.
mask
=
LVIF_TEXT
|
LVIF_IMAGE
;
item
.
iImage
=
I_IMAGECALLBACK
;
item
.
pszText
=
LPSTR_TEXTCALLBACKW
;
for
(
nItem
=
0
;
nItem
<
infoPtr
->
nItemCount
;
nItem
++
)
{
hdpaSubItems
=
DPA_GetPtr
(
infoPtr
->
hdpaItems
,
nItem
);
...
...
@@ -7893,6 +7899,10 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
if
(
lpSubItem
->
iSubItem
>=
nNewColumn
)
lpSubItem
->
iSubItem
++
;
}
/* add new subitem for each item */
item
.
iItem
=
nItem
;
set_sub_item
(
infoPtr
,
&
item
,
isW
,
&
changed
);
}
}
...
...
dlls/comctl32/tests/listview.c
View file @
dd3fc178
...
...
@@ -45,7 +45,7 @@
static
const
WCHAR
testparentclassW
[]
=
{
'L'
,
'i'
,
's'
,
't'
,
'v'
,
'i'
,
'e'
,
'w'
,
' '
,
't'
,
'e'
,
's'
,
't'
,
' '
,
'p'
,
'a'
,
'r'
,
'e'
,
'n'
,
't'
,
'W'
,
0
};
HWND
hwndparent
,
hwndparentW
;
static
HWND
hwndparent
,
hwndparentW
;
/* prevents edit box creation, LVN_BEGINLABELEDIT return value */
static
BOOL
blockEdit
;
/* return nonzero on NM_HOVER */
...
...
@@ -54,9 +54,11 @@ static BOOL g_block_hover;
static
BOOL
g_dump_itemchanged
;
/* format reported to control:
-1 falls to defproc, anything else returned */
INT
notifyFormat
;
static
INT
notifyFormat
;
/* indicates we're running < 5.80 version */
BOOL
g_is_below_5
;
static
BOOL
g_is_below_5
;
/* item data passed to LVN_GETDISPINFOA */
static
LVITEMA
g_itema
;
static
HWND
subclass_editbox
(
HWND
hwndListview
);
...
...
@@ -366,6 +368,12 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
nmlv
->
iItem
,
nmlv
->
uNewState
,
nmlv
->
uOldState
,
nmlv
->
uChanged
);
}
break
;
case
LVN_GETDISPINFOA
:
{
NMLVDISPINFOA
*
dispinfo
=
(
NMLVDISPINFOA
*
)
lParam
;
g_itema
=
dispinfo
->
item
;
}
break
;
case
NM_HOVER
:
if
(
g_block_hover
)
return
1
;
break
;
...
...
@@ -1187,24 +1195,25 @@ static void test_items(void)
static
void
test_columns
(
void
)
{
HWND
hwnd
,
hwndheader
;
LVCOLUMN
column
;
DWORD
rc
;
LVCOLUMN
A
column
;
LVITEMA
item
;
INT
order
[
2
];
CHAR
buff
[
5
];
DWORD
rc
;
hwnd
=
CreateWindowEx
(
0
,
"SysListView32"
,
"foo"
,
LVS_REPORT
,
hwnd
=
CreateWindowEx
A
(
0
,
"SysListView32"
,
"foo"
,
LVS_REPORT
,
10
,
10
,
100
,
200
,
hwndparent
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"failed to create listview window
\n
"
);
/* Add a column with no mask */
memset
(
&
column
,
0xcc
,
sizeof
(
column
));
column
.
mask
=
0
;
rc
=
ListView_InsertColumn
(
hwnd
,
0
,
&
column
);
ok
(
rc
==
0
,
"Inserting column with no mask failed with %d
\n
"
,
rc
);
rc
=
SendMessageA
(
hwnd
,
LVM_INSERTCOLUMNA
,
0
,
(
LPARAM
)
&
column
);
ok
(
rc
==
0
,
"Inserting column with no mask failed with %d
\n
"
,
rc
);
/* Check its width */
rc
=
ListView_GetColumnWidth
(
hwnd
,
0
);
ok
(
rc
==
10
||
broken
(
rc
==
0
),
/* win9x */
rc
=
SendMessageA
(
hwnd
,
LVM_GETCOLUMNWIDTH
,
0
,
0
);
ok
(
rc
==
10
||
broken
(
rc
==
0
)
/* win9x */
,
"Inserting column with no mask failed to set width to 10 with %d
\n
"
,
rc
);
DestroyWindow
(
hwnd
);
...
...
@@ -1216,24 +1225,43 @@ static void test_columns(void)
memset
(
&
column
,
0
,
sizeof
(
column
));
column
.
mask
=
LVCF_WIDTH
;
column
.
cx
=
100
;
rc
=
ListView_InsertColumn
(
hwnd
,
0
,
&
column
);
rc
=
SendMessageA
(
hwnd
,
LVM_INSERTCOLUMNA
,
0
,
(
LPARAM
)
&
column
);
ok
(
rc
==
0
,
"Inserting column failed with %d
\n
"
,
rc
);
column
.
cx
=
200
;
rc
=
ListView_InsertColumn
(
hwnd
,
1
,
&
column
);
rc
=
SendMessageA
(
hwnd
,
LVM_INSERTCOLUMNA
,
1
,
(
LPARAM
)
&
column
);
ok
(
rc
==
1
,
"Inserting column failed with %d
\n
"
,
rc
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
rc
=
SendMessage
(
hwnd
,
LVM_GETCOLUMNORDERARRAY
,
2
,
(
LPARAM
)
&
order
);
ok
(
rc
!=
0
,
"Expected LVM_GETCOLUMNORDERARRAY to succeed
\n
"
);
rc
=
SendMessage
A
(
hwnd
,
LVM_GETCOLUMNORDERARRAY
,
2
,
(
LPARAM
)
&
order
);
ok
(
rc
==
1
,
"Expected LVM_GETCOLUMNORDERARRAY to succeed
\n
"
);
ok
(
order
[
0
]
==
0
,
"Expected order 0, got %d
\n
"
,
order
[
0
]);
ok
(
order
[
1
]
==
1
,
"Expected order 1, got %d
\n
"
,
order
[
1
]);
ok_sequence
(
sequences
,
LISTVIEW_SEQ_INDEX
,
listview_getorderarray_seq
,
"get order array"
,
FALSE
);
/* after column added subitem is considered as present */
insert_item
(
hwnd
,
0
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
item
.
pszText
=
buff
;
item
.
cchTextMax
=
sizeof
(
buff
);
item
.
iItem
=
0
;
item
.
iSubItem
=
1
;
item
.
mask
=
LVIF_TEXT
;
memset
(
&
g_itema
,
0
,
sizeof
(
g_itema
));
rc
=
SendMessageA
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
rc
==
1
,
"got %d
\n
"
,
rc
);
ok
(
g_itema
.
iSubItem
==
1
,
"got %d
\n
"
,
g_itema
.
iSubItem
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
single_getdispinfo_parent_seq
,
"get subitem text after column added"
,
FALSE
);
DestroyWindow
(
hwnd
);
}
/* test setting imagelist between WM_NCCREATE and WM_CREATE */
static
WNDPROC
listviewWndProc
;
static
HIMAGELIST
test_create_imagelist
;
...
...
@@ -3389,7 +3417,6 @@ static void test_getitemrect(void)
expect
(
2
+
16
,
rect
.
left
);
expect
(
34
,
rect
.
right
);
DestroyWindow
(
hwnd
);
}
...
...
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