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
8d8c87b8
Commit
8d8c87b8
authored
Oct 25, 2000
by
Susan Farley
Committed by
Alexandre Julliard
Oct 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- When inserting an item, do not invalidate the area above the new
item. - The debug function that verifies the tree after each insertion should be disabled by default.
parent
49b3cec1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
41 deletions
+41
-41
treeview.c
dlls/comctl32/treeview.c
+41
-41
No files found.
dlls/comctl32/treeview.c
View file @
8d8c87b8
...
...
@@ -160,8 +160,7 @@ DEFAULT_DEBUG_CHANNEL(treeview);
typedef
VOID
(
*
TREEVIEW_ItemEnumFunc
)(
TREEVIEW_INFO
*
,
TREEVIEW_ITEM
*
,
LPVOID
);
static
VOID
TREEVIEW_QueueRefresh
(
TREEVIEW_INFO
*
);
static
VOID
TREEVIEW_QueueItemRefresh
(
TREEVIEW_INFO
*
,
TREEVIEW_ITEM
*
);
static
VOID
TREEVIEW_Invalidate
(
TREEVIEW_INFO
*
,
TREEVIEW_ITEM
*
);
static
LRESULT
TREEVIEW_DoSelectItem
(
TREEVIEW_INFO
*
,
INT
,
HTREEITEM
,
INT
);
static
VOID
TREEVIEW_SetFirstVisible
(
TREEVIEW_INFO
*
,
TREEVIEW_ITEM
*
,
BOOL
);
...
...
@@ -174,7 +173,7 @@ static LRESULT TREEVIEW_HScroll(TREEVIEW_INFO *, WPARAM);
/* Random Utilities *****************************************************/
#ifdef NDEBUG
#if
n
def NDEBUG
static
inline
void
TREEVIEW_VerifyTree
(
TREEVIEW_INFO
*
infoPtr
)
{
...
...
@@ -1150,6 +1149,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
if
(
parentItem
==
infoPtr
->
root
||
(
ISVISIBLE
(
parentItem
)
&&
parentItem
->
state
&
TVIS_EXPANDED
))
{
TREEVIEW_ITEM
*
item
;
TREEVIEW_ITEM
*
prev
=
TREEVIEW_GetPrevListItem
(
infoPtr
,
newItem
);
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
prev
);
...
...
@@ -1160,7 +1160,14 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
TREEVIEW_ComputeTextWidth
(
infoPtr
,
newItem
,
0
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_QueueRefresh
(
infoPtr
);
/*
* if the item was inserted in a visible part of the tree,
* invalidate it, as well as those after it
*/
for
(
item
=
newItem
;
item
!=
NULL
;
item
=
TREEVIEW_GetNextListItem
(
infoPtr
,
item
))
TREEVIEW_Invalidate
(
infoPtr
,
item
);
}
else
{
...
...
@@ -1170,7 +1177,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
if
(
ISVISIBLE
(
parentItem
)
&&
newItem
->
prevSibling
==
newItem
->
nextSibling
)
{
/* parent got '+' - update it */
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
parentItem
);
TREEVIEW_
Invalidate
(
infoPtr
,
parentItem
);
}
}
...
...
@@ -1396,12 +1403,12 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem)
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
prev
);
TREEVIEW_SetFirstVisible
(
infoPtr
,
newFirstVisible
,
TRUE
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
else
if
(
ISVISIBLE
(
parent
)
&&
!
TREEVIEW_HasChildren
(
infoPtr
,
parent
))
{
/* parent lost '+/-' - update it */
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
parent
);
TREEVIEW_
Invalidate
(
infoPtr
,
parent
);
}
return
TRUE
;
...
...
@@ -1440,7 +1447,7 @@ TREEVIEW_SetIndent(TREEVIEW_INFO *infoPtr, UINT newIndent)
infoPtr
->
uIndent
=
newIndent
;
TREEVIEW_UpdateSubTree
(
infoPtr
,
infoPtr
->
root
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
return
0
;
...
...
@@ -1552,7 +1559,7 @@ TREEVIEW_SetImageList(TREEVIEW_INFO *infoPtr, WPARAM wParam, HIMAGELIST himlNew)
TREEVIEW_UpdateScrollBars
(
infoPtr
);
}
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
(
LRESULT
)
himlOld
;
}
...
...
@@ -1600,7 +1607,7 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight)
{
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
NULL
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
return
prevHeight
;
...
...
@@ -1656,7 +1663,7 @@ TREEVIEW_SetFont(TREEVIEW_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
TREEVIEW_UpdateScrollBars
(
infoPtr
);
if
(
bRedraw
)
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
0
;
}
...
...
@@ -1696,7 +1703,7 @@ TREEVIEW_SetTextColor(TREEVIEW_INFO *infoPtr, COLORREF color)
infoPtr
->
clrText
=
color
;
if
(
infoPtr
->
clrText
!=
prevColor
)
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
(
LRESULT
)
prevColor
;
}
...
...
@@ -1718,7 +1725,7 @@ TREEVIEW_SetBkColor(TREEVIEW_INFO *infoPtr, COLORREF newColor)
infoPtr
->
clrBk
=
newColor
;
if
(
newColor
!=
prevColor
)
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
(
LRESULT
)
prevColor
;
}
...
...
@@ -1754,7 +1761,7 @@ TREEVIEW_SetInsertMark(TREEVIEW_INFO *infoPtr, BOOL wParam, HTREEITEM item)
infoPtr
->
insertBeforeorAfter
=
wParam
;
infoPtr
->
insertMarkItem
=
item
;
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
1
;
}
...
...
@@ -1901,12 +1908,12 @@ TREEVIEW_SetItemA(TREEVIEW_INFO *infoPtr, LPTVITEMEXA tvItem)
TREEVIEW_RecalculateVisibleOrder
(
infoPtr
,
wineItem
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
else
{
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
wineItem
);
TREEVIEW_
Invalidate
(
infoPtr
,
wineItem
);
}
}
}
...
...
@@ -2079,7 +2086,7 @@ TREEVIEW_ToggleItemState(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
item
->
state
|=
INDEXTOSTATEIMAGEMASK
(
state
);
TRACE
(
"state:%x
\n
"
,
state
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
item
);
TREEVIEW_
Invalidate
(
infoPtr
,
item
);
}
}
...
...
@@ -2598,19 +2605,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, RECT *rc)
}
static
void
TREEVIEW_QueueRefresh
(
TREEVIEW_INFO
*
infoPtr
)
{
InvalidateRect
(
infoPtr
->
hwnd
,
NULL
,
TRUE
);
}
/* It be that item->rect is out of date. If so, we invalidate the wrong area,
* but then whoever updates item->rect knows that they must invalidate after
* correcting it. */
static
void
TREEVIEW_QueueItemRefresh
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
)
TREEVIEW_Invalidate
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
)
{
if
(
item
!=
NULL
)
InvalidateRect
(
infoPtr
->
hwnd
,
&
item
->
rect
,
TRUE
);
else
InvalidateRect
(
infoPtr
->
hwnd
,
NULL
,
TRUE
);
}
static
LRESULT
...
...
@@ -2820,7 +2820,7 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
TREEVIEW_SetFirstVisible
(
infoPtr
,
item
,
FALSE
);
}
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
return
TRUE
;
...
...
@@ -2938,7 +2938,7 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
}
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
TRUE
;
}
...
...
@@ -3012,7 +3012,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
}
}
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
TRUE
;
}
...
...
@@ -3942,8 +3942,8 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
TVIF_HANDLE
|
TVIF_STATE
|
TVIF_PARAM
,
prevSelect
,
newSelect
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
prevSelect
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
newSelect
);
TREEVIEW_
Invalidate
(
infoPtr
,
prevSelect
);
TREEVIEW_
Invalidate
(
infoPtr
,
newSelect
);
break
;
case
TVGN_DROPHILITE
:
...
...
@@ -3957,14 +3957,14 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
if
(
newSelect
)
newSelect
->
state
|=
TVIS_DROPHILITED
;
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
prevSelect
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
newSelect
);
TREEVIEW_
Invalidate
(
infoPtr
,
prevSelect
);
TREEVIEW_
Invalidate
(
infoPtr
,
newSelect
);
break
;
case
TVGN_FIRSTVISIBLE
:
TREEVIEW_EnsureVisible
(
infoPtr
,
newSelect
,
FALSE
);
TREEVIEW_SetFirstVisible
(
infoPtr
,
newSelect
,
TRUE
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
break
;
}
...
...
@@ -4112,7 +4112,7 @@ TREEVIEW_SetFirstVisible(TREEVIEW_INFO *infoPtr,
if
(
infoPtr
->
firstVisible
==
NULL
||
newFirstVisible
==
NULL
)
{
infoPtr
->
firstVisible
=
newFirstVisible
;
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
}
else
{
...
...
@@ -4661,7 +4661,7 @@ TREEVIEW_Size(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
FIXME
(
"WM_SIZE flag %x %lx not handled
\n
"
,
wParam
,
lParam
);
}
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
0
;
}
...
...
@@ -4694,7 +4694,7 @@ TREEVIEW_StyleChanged(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TREEVIEW_UpdateSubTree
(
infoPtr
,
infoPtr
->
root
);
TREEVIEW_UpdateScrollBars
(
infoPtr
);
TREEVIEW_
QueueRefresh
(
infoPtr
);
TREEVIEW_
Invalidate
(
infoPtr
,
NULL
);
return
0
;
}
...
...
@@ -4711,7 +4711,7 @@ TREEVIEW_SetFocus(TREEVIEW_INFO *infoPtr)
}
TREEVIEW_SendSimpleNotify
(
infoPtr
,
NM_SETFOCUS
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
infoPtr
->
selectedItem
);
TREEVIEW_
Invalidate
(
infoPtr
,
infoPtr
->
selectedItem
);
return
0
;
}
...
...
@@ -4721,7 +4721,7 @@ TREEVIEW_KillFocus(TREEVIEW_INFO *infoPtr)
TRACE
(
"
\n
"
);
TREEVIEW_SendSimpleNotify
(
infoPtr
,
NM_KILLFOCUS
);
TREEVIEW_
QueueItemRefresh
(
infoPtr
,
infoPtr
->
selectedItem
);
TREEVIEW_
Invalidate
(
infoPtr
,
infoPtr
->
selectedItem
);
return
0
;
}
...
...
@@ -5014,7 +5014,7 @@ TREEVIEW_Unregister(void)
/* Tree Verification ****************************************************/
#if
n
def NDEBUG
#ifdef NDEBUG
static
inline
void
TREEVIEW_VerifyChildren
(
TREEVIEW_INFO
*
infoPtr
,
TREEVIEW_ITEM
*
item
);
...
...
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