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
a0ebe244
Commit
a0ebe244
authored
May 17, 2015
by
Alex Henrie
Committed by
Alexandre Julliard
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Close previously selected treeview item at common ancestor.
Also, send WM_NOTIFY mesages when collapsing the previous selection and expanding the new one.
parent
9f930807
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
34 deletions
+14
-34
treeview.c
dlls/comctl32/tests/treeview.c
+3
-7
treeview.c
dlls/comctl32/treeview.c
+11
-27
No files found.
dlls/comctl32/tests/treeview.c
View file @
a0ebe244
...
...
@@ -1767,9 +1767,9 @@ static void test_TVS_SINGLEEXPAND(void)
{
{
&
alpha
,
parent_singleexpand_seq0
,
FALSE
},
{
&
bravo
,
parent_singleexpand_seq1
,
FALSE
},
{
&
delta
,
parent_singleexpand_seq2
,
TRU
E
},
{
&
foxtrot
,
parent_singleexpand_seq3
,
TRU
E
},
{
&
alpha
,
parent_singleexpand_seq4
,
TRU
E
},
{
&
delta
,
parent_singleexpand_seq2
,
FALS
E
},
{
&
foxtrot
,
parent_singleexpand_seq3
,
FALS
E
},
{
&
alpha
,
parent_singleexpand_seq4
,
FALS
E
},
{
&
golf
,
parent_singleexpand_seq5
,
TRUE
},
{
&
hotel
,
parent_singleexpand_seq6
,
FALSE
},
{
&
india
,
parent_singleexpand_seq7
,
FALSE
},
...
...
@@ -1801,10 +1801,6 @@ static void test_TVS_SINGLEEXPAND(void)
for
(
i
=
0
;
i
<
sizeof
(
items
)
/
sizeof
(
items
[
0
]);
i
++
)
{
ret
=
SendMessageA
(
hTree
,
TVM_GETITEMSTATE
,
(
WPARAM
)(
*
items
[
i
].
handle
),
0xFFFF
);
if
(
i
==
0
)
todo_wine
ok
(
ret
==
items
[
i
].
final_state
,
"singleexpand items[%d]: expected state 0x%x got 0x%x
\n
"
,
i
,
items
[
i
].
final_state
,
ret
);
else
ok
(
ret
==
items
[
i
].
final_state
,
"singleexpand items[%d]: expected state 0x%x got 0x%x
\n
"
,
i
,
items
[
i
].
final_state
,
ret
);
}
...
...
dlls/comctl32/treeview.c
View file @
a0ebe244
...
...
@@ -29,7 +29,7 @@
*
* TODO:
* missing notifications: TVN_GETINFOTIP, TVN_KEYDOWN,
* TVN_SETDISPINFO
, TVN_SINGLEEXPAND
* TVN_SETDISPINFO
*
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
*
...
...
@@ -3508,47 +3508,31 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item,
static
void
TREEVIEW_SingleExpand
(
TREEVIEW_INFO
*
infoPtr
,
HTREEITEM
selection
,
HTREEITEM
item
)
{
TREEVIEW_ITEM
*
SelItem
;
TREEVIEW_ITEM
*
prev
,
*
curr
;
if
((
infoPtr
->
dwStyle
&
TVS_SINGLEEXPAND
)
==
0
||
infoPtr
->
hwndEdit
||
!
item
)
return
;
TREEVIEW_SendTreeviewNotify
(
infoPtr
,
TVN_SINGLEEXPAND
,
TVC_UNKNOWN
,
TVIF_HANDLE
|
TVIF_PARAM
,
item
,
0
);
/*
* Close the previous
selection all the way to the ro
ot
* a
s long as the new selection is not a child
* Close the previous
item and its ancestors as long as they are n
ot
* a
ncestors of the current item
*/
if
(
selection
&&
(
selection
!=
item
)
)
for
(
prev
=
selection
;
prev
&&
TREEVIEW_ValidItem
(
infoPtr
,
prev
);
prev
=
prev
->
parent
)
{
BOOL
closeit
=
TRUE
;
SelItem
=
item
;
/* determine if the hitItem is a child of the currently selected item */
while
(
closeit
&&
SelItem
&&
TREEVIEW_ValidItem
(
infoPtr
,
SelItem
)
&&
(
SelItem
->
parent
!=
infoPtr
->
root
))
{
closeit
=
(
SelItem
!=
selection
);
SelItem
=
SelItem
->
parent
;
}
if
(
closeit
)
for
(
curr
=
item
;
curr
&&
TREEVIEW_ValidItem
(
infoPtr
,
curr
);
curr
=
curr
->
parent
)
{
if
(
TREEVIEW_ValidItem
(
infoPtr
,
selection
))
SelItem
=
selection
;
while
(
SelItem
&&
(
SelItem
!=
item
)
&&
TREEVIEW_ValidItem
(
infoPtr
,
SelItem
)
&&
SelItem
->
parent
!=
infoPtr
->
root
)
{
TREEVIEW_Collapse
(
infoPtr
,
SelItem
,
FALSE
,
FALSE
);
SelItem
=
SelItem
->
parent
;
}
if
(
curr
==
prev
)
goto
finish
;
}
TREEVIEW_Collapse
(
infoPtr
,
prev
,
FALSE
,
TRUE
);
}
finish:
/*
* Expand the current item
*/
TREEVIEW_Expand
(
infoPtr
,
item
,
FALSE
,
FALS
E
);
TREEVIEW_Expand
(
infoPtr
,
item
,
FALSE
,
TRU
E
);
}
static
BOOL
...
...
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