Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bcb98d11
Commit
bcb98d11
authored
May 24, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: TVM_EXPAND with TVE_TOGGLE action shouldn't always notify as…
comctl32/treeview: TVM_EXPAND with TVE_TOGGLE action shouldn't always notify as it does on user input.
parent
7f5e7294
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
13 deletions
+30
-13
treeview.c
dlls/comctl32/tests/treeview.c
+25
-8
treeview.c
dlls/comctl32/treeview.c
+5
-5
No files found.
dlls/comctl32/tests/treeview.c
View file @
bcb98d11
...
...
@@ -1302,12 +1302,12 @@ static void test_expandnotify(void)
item
.
state
=
TVIS_EXPANDED
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
ok
((
item
.
state
&
TVIS_EXPANDED
)
==
0
,
"expected collapsed
\n
"
);
/* preselect root node here */
ret
=
SendMessageA
(
hTree
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
hRoot
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
g_get_from_expand
=
TRUE
;
/* expand */
...
...
@@ -1315,7 +1315,7 @@ static void test_expandnotify(void)
g_item_expanding
.
state
=
0xdeadbeef
;
g_item_expanded
.
state
=
0xdeadbeef
;
ret
=
SendMessageA
(
hTree
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hRoot
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
ok
(
g_item_expanding
.
state
==
TVIS_SELECTED
,
"got state on TVN_ITEMEXPANDING 0x%08x
\n
"
,
g_item_expanding
.
state
);
ok
(
g_item_expanded
.
state
==
(
TVIS_SELECTED
|
TVIS_EXPANDED
),
"got state on TVN_ITEMEXPANDED 0x%08x
\n
"
,
...
...
@@ -1326,16 +1326,16 @@ static void test_expandnotify(void)
/* check that it's expanded */
item
.
state
=
TVIS_EXPANDED
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
ok
((
item
.
state
&
TVIS_EXPANDED
)
==
TVIS_EXPANDED
,
"expected expanded
\n
"
);
/* collapse */
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ret
=
SendMessageA
(
hTree
,
TVM_EXPAND
,
TVE_COLLAPSE
,
(
LPARAM
)
hRoot
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
item
.
state
=
TVIS_EXPANDED
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
expect
(
TRUE
,
ret
);
ok
((
item
.
state
&
TVIS_EXPANDED
)
==
0
,
"expected collapsed
\n
"
);
/* all next collapse/expand attempts won't produce any notifications,
the only way is to reset with all children removed */
...
...
@@ -1345,7 +1345,7 @@ static void test_expandnotify(void)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ret
=
SendMessageA
(
hTree
,
TVM_EXPAND
,
TVE_TOGGLE
,
(
LPARAM
)
hChild
);
expect
(
FALSE
,
ret
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_seq
,
"toggle node without children"
,
TRU
E
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_seq
,
"toggle node without children"
,
FALS
E
);
DestroyWindow
(
hTree
);
...
...
@@ -1354,8 +1354,25 @@ static void test_expandnotify(void)
fill_tree
(
hTree
);
g_get_rect_in_expand
=
TRUE
;
ret
=
TreeView_Select
(
hTree
,
hChild
,
TVGN_CARET
);
expect
(
TRUE
,
ret
);
g_get_rect_in_expand
=
FALSE
;
ok
(
ret
,
"got %d
\n
"
,
ret
);
DestroyWindow
(
hTree
);
/* TVE_TOGGLE acts as any other TVM_EXPAND */
hTree
=
create_treeview_control
(
0
);
fill_tree
(
hTree
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ret
=
SendMessageA
(
hTree
,
TVM_EXPAND
,
TVE_TOGGLE
,
(
LPARAM
)
hRoot
);
expect
(
TRUE
,
ret
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_expand_seq
,
"toggle node (expand)"
,
FALSE
);
/* toggle again - no notifications */
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ret
=
SendMessageA
(
hTree
,
TVM_EXPAND
,
TVE_TOGGLE
,
(
LPARAM
)
hRoot
);
expect
(
TRUE
,
ret
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_seq
,
"toggle node (collapse)"
,
FALSE
);
DestroyWindow
(
hTree
);
}
...
...
dlls/comctl32/treeview.c
View file @
bcb98d11
...
...
@@ -3489,14 +3489,14 @@ static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
}
static
BOOL
TREEVIEW_Toggle
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
,
BOOL
bU
ser
)
TREEVIEW_Toggle
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
,
BOOL
u
ser
)
{
TRACE
(
"
\n
"
);
TRACE
(
"
item=%p, user=%d
\n
"
,
item
,
user
);
if
(
item
->
state
&
TVIS_EXPANDED
)
return
TREEVIEW_Collapse
(
infoPtr
,
item
,
FALSE
,
bU
ser
);
return
TREEVIEW_Collapse
(
infoPtr
,
item
,
FALSE
,
u
ser
);
else
return
TREEVIEW_Expand
(
infoPtr
,
item
,
FALSE
,
bU
ser
);
return
TREEVIEW_Expand
(
infoPtr
,
item
,
FALSE
,
u
ser
);
}
static
VOID
...
...
@@ -3538,7 +3538,7 @@ TREEVIEW_ExpandMsg(TREEVIEW_INFO *infoPtr, UINT flag, HTREEITEM item)
FALSE
);
case
TVE_TOGGLE
:
return
TREEVIEW_Toggle
(
infoPtr
,
item
,
TRU
E
);
return
TREEVIEW_Toggle
(
infoPtr
,
item
,
FALS
E
);
default:
return
0
;
...
...
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