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
6ec621e8
Commit
6ec621e8
authored
Oct 31, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Make item data layout partially compatible with native one.
parent
f45ac5a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
3 deletions
+57
-3
treeview.c
dlls/comctl32/tests/treeview.c
+53
-0
treeview.c
dlls/comctl32/treeview.c
+4
-3
No files found.
dlls/comctl32/tests/treeview.c
View file @
6ec621e8
...
...
@@ -1369,6 +1369,57 @@ static void test_delete_items(void)
DestroyWindow
(
hTree
);
}
struct
_ITEM_DATA
{
HTREEITEM
parent
;
/* for root value of parent field is unidetified */
HTREEITEM
nextsibling
;
HTREEITEM
firstchild
;
};
static
void
_check_item
(
HTREEITEM
item
,
HTREEITEM
parent
,
HTREEITEM
nextsibling
,
HTREEITEM
firstchild
,
int
line
)
{
struct
_ITEM_DATA
*
data
=
(
struct
_ITEM_DATA
*
)
item
;
ok_
(
__FILE__
,
line
)(
data
->
parent
==
parent
,
"parent %p, got %p
\n
"
,
parent
,
data
->
parent
);
ok_
(
__FILE__
,
line
)(
data
->
nextsibling
==
nextsibling
,
"sibling %p, got %p
\n
"
,
nextsibling
,
data
->
nextsibling
);
ok_
(
__FILE__
,
line
)(
data
->
firstchild
==
firstchild
,
"firstchild %p, got %p
\n
"
,
firstchild
,
data
->
firstchild
);
}
#define check_item(a, b, c, d) _check_item(a, b, c, d, __LINE__)
static
void
test_htreeitem_layout
(
void
)
{
TVINSERTSTRUCTA
ins
;
HTREEITEM
item1
,
item2
;
HWND
hTree
;
hTree
=
create_treeview_control
();
fill_tree
(
hTree
);
/* root has some special pointer in parent field */
check_item
(
hRoot
,
((
struct
_ITEM_DATA
*
)
hRoot
)
->
parent
,
0
,
hChild
);
check_item
(
hChild
,
hRoot
,
0
,
0
);
ins
.
hParent
=
hChild
;
ins
.
hInsertAfter
=
TVI_FIRST
;
item1
=
TreeView_InsertItem
(
hTree
,
&
ins
);
check_item
(
item1
,
hChild
,
0
,
0
);
ins
.
hParent
=
hRoot
;
ins
.
hInsertAfter
=
TVI_FIRST
;
item2
=
TreeView_InsertItem
(
hTree
,
&
ins
);
check_item
(
item2
,
hRoot
,
hChild
,
0
);
SendMessage
(
hTree
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
hChild
);
/* without children now */
check_item
(
hRoot
,
((
struct
_ITEM_DATA
*
)
hRoot
)
->
parent
,
0
,
item2
);
DestroyWindow
(
hTree
);
}
START_TEST
(
treeview
)
{
HMODULE
hComctl32
;
...
...
@@ -1437,6 +1488,7 @@ START_TEST(treeview)
test_TVS_SINGLEEXPAND
();
test_WM_PAINT
();
test_delete_items
();
test_htreeitem_layout
();
if
(
!
load_v6_module
(
&
ctx_cookie
,
&
hCtx
))
{
...
...
@@ -1461,6 +1513,7 @@ START_TEST(treeview)
/* comctl32 version 6 tests start here */
test_expandedimage
();
test_htreeitem_layout
();
unload_v6_module
(
ctx_cookie
,
hCtx
);
...
...
dlls/comctl32/treeview.c
View file @
6ec621e8
...
...
@@ -70,6 +70,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(treeview);
typedef
struct
_TREEITEM
/* HTREEITEM is a _TREEINFO *. */
{
HTREEITEM
parent
;
/* handle to parent or 0 if at root */
HTREEITEM
nextSibling
;
/* handle to next item in list, 0 if last */
HTREEITEM
firstChild
;
/* handle to first child or 0 if no child */
UINT
callbackMask
;
UINT
state
;
UINT
stateMask
;
...
...
@@ -82,11 +86,8 @@ typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */
LPARAM
lParam
;
int
iIntegral
;
/* item height multiplier (1 is normal) */
int
iLevel
;
/* indentation level:0=root level */
HTREEITEM
parent
;
/* handle to parent or 0 if at root */
HTREEITEM
firstChild
;
/* handle to first child or 0 if no child */
HTREEITEM
lastChild
;
HTREEITEM
prevSibling
;
/* handle to prev item in list, 0 if first */
HTREEITEM
nextSibling
;
/* handle to next item in list, 0 if last */
RECT
rect
;
LONG
linesOffset
;
LONG
stateOffset
;
...
...
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