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
95a15a34
Commit
95a15a34
authored
May 22, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Make it possible to use TVM_GETITEM with item from another tree.
parent
d7ccfef2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
32 deletions
+49
-32
treeview.c
dlls/comctl32/tests/treeview.c
+12
-1
treeview.c
dlls/comctl32/treeview.c
+37
-31
No files found.
dlls/comctl32/tests/treeview.c
View file @
95a15a34
...
...
@@ -746,8 +746,8 @@ static void test_get_set_item(void)
TVITEMA
tviRoot
=
{
0
};
int
nBufferSize
=
80
;
char
szBuffer
[
80
]
=
{
0
};
HWND
hTree
,
hTree2
;
DWORD
ret
;
HWND
hTree
;
hTree
=
create_treeview_control
(
0
);
fill_tree
(
hTree
);
...
...
@@ -791,7 +791,18 @@ static void test_get_set_item(void)
ok_sequence
(
sequences
,
TREEVIEW_SEQ_INDEX
,
test_get_set_item_seq
,
"test get set item"
,
FALSE
);
/* get item from a different tree */
hTree2
=
create_treeview_control
(
0
);
tviRoot
.
hItem
=
hRoot
;
tviRoot
.
mask
=
TVIF_STATE
;
tviRoot
.
state
=
0
;
ret
=
SendMessage
(
hTree2
,
TVM_GETITEMA
,
0
,
(
LPARAM
)
&
tviRoot
);
expect
(
TRUE
,
ret
);
ok
(
tviRoot
.
state
==
TVIS_FOCUSED
,
"got state 0x%0x
\n
"
,
tviRoot
.
state
);
DestroyWindow
(
hTree
);
DestroyWindow
(
hTree2
);
}
static
void
test_get_set_itemheight
(
void
)
...
...
dlls/comctl32/treeview.c
View file @
95a15a34
...
...
@@ -67,36 +67,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
treeview
);
/* internal structures */
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
;
LPWSTR
pszText
;
int
cchTextMax
;
int
iImage
;
int
iSelectedImage
;
int
iExpandedImage
;
int
cChildren
;
LPARAM
lParam
;
int
iIntegral
;
/* item height multiplier (1 is normal) */
int
iLevel
;
/* indentation level:0=root level */
HTREEITEM
lastChild
;
HTREEITEM
prevSibling
;
/* handle to prev item in list, 0 if first */
RECT
rect
;
LONG
linesOffset
;
LONG
stateOffset
;
LONG
imageOffset
;
LONG
textOffset
;
LONG
textWidth
;
/* horizontal text extent for pszText */
LONG
visibleOrder
;
/* visible ordering, 0 is first visible item */
}
TREEVIEW_ITEM
;
typedef
struct
tagTREEVIEW_INFO
{
HWND
hwnd
;
...
...
@@ -163,6 +133,35 @@ typedef struct tagTREEVIEW_INFO
WCHAR
szSearchParam
[
MAX_PATH
];
}
TREEVIEW_INFO
;
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
;
LPWSTR
pszText
;
int
cchTextMax
;
int
iImage
;
int
iSelectedImage
;
int
iExpandedImage
;
int
cChildren
;
LPARAM
lParam
;
int
iIntegral
;
/* item height multiplier (1 is normal) */
int
iLevel
;
/* indentation level:0=root level */
HTREEITEM
lastChild
;
HTREEITEM
prevSibling
;
/* handle to prev item in list, 0 if first */
RECT
rect
;
LONG
linesOffset
;
LONG
stateOffset
;
LONG
imageOffset
;
LONG
textOffset
;
LONG
textWidth
;
/* horizontal text extent for pszText */
LONG
visibleOrder
;
/* visible ordering, 0 is first visible item */
const
TREEVIEW_INFO
*
infoPtr
;
/* tree data this item belongs to */
}
TREEVIEW_ITEM
;
/******** Defines that TREEVIEW_ProcessLetterKeys uses ****************/
#define KEY_DELAY 450
...
...
@@ -1012,6 +1011,7 @@ TREEVIEW_AllocateItem(const TREEVIEW_INFO *infoPtr)
newItem
->
iImage
=
0
;
newItem
->
iSelectedImage
=
0
;
newItem
->
iExpandedImage
=
(
WORD
)
I_IMAGENONE
;
newItem
->
infoPtr
=
infoPtr
;
if
(
DPA_InsertPtr
(
infoPtr
->
items
,
INT_MAX
,
newItem
)
==
-
1
)
{
...
...
@@ -2082,7 +2082,13 @@ TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW)
TREEVIEW_ITEM
*
item
=
tvItem
->
hItem
;
if
(
!
TREEVIEW_ValidItem
(
infoPtr
,
item
))
return
FALSE
;
{
if
(
!
item
)
return
FALSE
;
TRACE
(
"got item from different tree %p, called from %p
\n
"
,
item
->
infoPtr
,
infoPtr
);
infoPtr
=
item
->
infoPtr
;
if
(
!
TREEVIEW_ValidItem
(
infoPtr
,
item
))
return
FALSE
;
}
TREEVIEW_UpdateDispInfo
(
infoPtr
,
item
,
tvItem
->
mask
);
...
...
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