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
5a6f9561
Commit
5a6f9561
authored
Apr 21, 2009
by
Florian Köberle
Committed by
Alexandre Julliard
Apr 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix expanding of invisible sub trees.
parent
123dc34a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
43 deletions
+43
-43
treeview.c
dlls/comctl32/tests/treeview.c
+0
-3
treeview.c
dlls/comctl32/treeview.c
+43
-40
No files found.
dlls/comctl32/tests/treeview.c
View file @
5a6f9561
...
...
@@ -810,13 +810,10 @@ static void TestExpandInvisible(void)
nodeVisible
=
TreeView_GetItemRect
(
hTree
,
node
[
1
],
&
dummyRect
,
FALSE
);
ok
(
!
nodeVisible
,
"Node 1 should not be visible.
\n
"
);
nodeVisible
=
TreeView_GetItemRect
(
hTree
,
node
[
2
],
&
dummyRect
,
FALSE
);
todo_wine
ok
(
!
nodeVisible
,
"Node 2 should not be visible.
\n
"
);
nodeVisible
=
TreeView_GetItemRect
(
hTree
,
node
[
3
],
&
dummyRect
,
FALSE
);
todo_wine
ok
(
!
nodeVisible
,
"Node 3 should not be visible.
\n
"
);
nodeVisible
=
TreeView_GetItemRect
(
hTree
,
node
[
4
],
&
dummyRect
,
FALSE
);
todo_wine
ok
(
!
nodeVisible
,
"Node 4 should not be visible.
\n
"
);
}
...
...
dlls/comctl32/treeview.c
View file @
5a6f9561
...
...
@@ -3292,56 +3292,59 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if
(
bExpandPartial
)
FIXME
(
"TVE_EXPANDPARTIAL not implemented
\n
"
);
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
wineItem
);
TREEVIEW_UpdateSubTree
(
infoPtr
,
wineItem
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
scrollRect
.
left
=
0
;
scrollRect
.
bottom
=
infoPtr
->
treeHeight
;
scrollRect
.
right
=
infoPtr
->
clientWidth
;
if
(
nextItem
)
if
(
ISVISIBLE
(
wineItem
))
{
scrollDist
=
nextItem
->
rect
.
top
-
orgNextTop
;
scrollRect
.
top
=
orgNextTop
;
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
wineItem
);
TREEVIEW_UpdateSubTree
(
infoPtr
,
wineItem
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
ScrollWindowEx
(
infoPtr
->
hwnd
,
0
,
scrollDist
,
&
scrollRect
,
NULL
,
NULL
,
NULL
,
SW_ERASE
|
SW_INVALIDATE
);
TREEVIEW_Invalidate
(
infoPtr
,
wineItem
);
}
else
{
scrollRect
.
top
=
wineItem
->
rect
.
top
;
InvalidateRect
(
infoPtr
->
hwnd
,
&
scrollRect
,
FALSE
);
}
scrollRect
.
left
=
0
;
scrollRect
.
bottom
=
infoPtr
->
treeHeight
;
scrollRect
.
right
=
infoPtr
->
clientWidth
;
if
(
nextItem
)
{
scrollDist
=
nextItem
->
rect
.
top
-
orgNextTop
;
scrollRect
.
top
=
orgNextTop
;
ScrollWindowEx
(
infoPtr
->
hwnd
,
0
,
scrollDist
,
&
scrollRect
,
NULL
,
NULL
,
NULL
,
SW_ERASE
|
SW_INVALIDATE
);
TREEVIEW_Invalidate
(
infoPtr
,
wineItem
);
}
else
{
scrollRect
.
top
=
wineItem
->
rect
.
top
;
InvalidateRect
(
infoPtr
->
hwnd
,
&
scrollRect
,
FALSE
);
}
/* Scroll up so that as many children as possible are visible.
* This fails when expanding causes an HScroll bar to appear, but we
* don't know that yet, so the last item is obscured. */
if
(
wineItem
->
firstChild
!=
NULL
)
{
int
nChildren
=
wineItem
->
lastChild
->
visibleOrder
-
wineItem
->
firstChild
->
visibleOrder
+
1
;
/* Scroll up so that as many children as possible are visible.
* This fails when expanding causes an HScroll bar to appear, but we
* don't know that yet, so the last item is obscured. */
if
(
wineItem
->
firstChild
!=
NULL
)
{
int
nChildren
=
wineItem
->
lastChild
->
visibleOrder
-
wineItem
->
firstChild
->
visibleOrder
+
1
;
int
visible_pos
=
wineItem
->
visibleOrder
-
infoPtr
->
firstVisible
->
visibleOrder
;
int
visible_pos
=
wineItem
->
visibleOrder
-
infoPtr
->
firstVisible
->
visibleOrder
;
int
rows_below
=
TREEVIEW_GetVisibleCount
(
infoPtr
)
-
visible_pos
-
1
;
int
rows_below
=
TREEVIEW_GetVisibleCount
(
infoPtr
)
-
visible_pos
-
1
;
if
(
visible_pos
>
0
&&
nChildren
>
rows_below
)
{
int
scroll
=
nChildren
-
rows_below
;
if
(
visible_pos
>
0
&&
nChildren
>
rows_below
)
{
int
scroll
=
nChildren
-
rows_below
;
if
(
scroll
>
visible_pos
)
scroll
=
visible_pos
;
if
(
scroll
>
visible_pos
)
scroll
=
visible_pos
;
if
(
scroll
>
0
)
{
TREEVIEW_ITEM
*
newFirstVisible
=
TREEVIEW_GetListItem
(
infoPtr
,
infoPtr
->
firstVisible
,
scroll
);
if
(
scroll
>
0
)
{
TREEVIEW_ITEM
*
newFirstVisible
=
TREEVIEW_GetListItem
(
infoPtr
,
infoPtr
->
firstVisible
,
scroll
);
TREEVIEW_SetFirstVisible
(
infoPtr
,
newFirstVisible
,
TRUE
);
}
}
TREEVIEW_SetFirstVisible
(
infoPtr
,
newFirstVisible
,
TRUE
);
}
}
}
}
return
TRUE
;
...
...
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