We need to send TVN_EXPAND* on collapsing either when the user has
initiated it with the mouse/keybaord or in response to a TVM_EXPAND when the state is not TVIS_EXPANDEDONCE. This brings the logic into line with TREEVIEW_Expand.
This commit is contained in:
parent
8a7fbf542d
commit
4a8e33954e
|
@ -3134,7 +3134,7 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||||
if (!(wineItem->state & TVIS_EXPANDED))
|
if (!(wineItem->state & TVIS_EXPANDED))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (bUser)
|
if (bUser || !(wineItem->state & TVIS_EXPANDEDONCE))
|
||||||
TREEVIEW_SendExpanding(infoPtr, wineItem, action);
|
TREEVIEW_SendExpanding(infoPtr, wineItem, action);
|
||||||
|
|
||||||
if (wineItem->firstChild == NULL)
|
if (wineItem->firstChild == NULL)
|
||||||
|
@ -3142,7 +3142,7 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||||
|
|
||||||
wineItem->state &= ~TVIS_EXPANDED;
|
wineItem->state &= ~TVIS_EXPANDED;
|
||||||
|
|
||||||
if (bUser)
|
if (bUser || !(wineItem->state & TVIS_EXPANDEDONCE))
|
||||||
TREEVIEW_SendExpanded(infoPtr, wineItem, action);
|
TREEVIEW_SendExpanded(infoPtr, wineItem, action);
|
||||||
|
|
||||||
bSetSelection = (infoPtr->selectedItem != NULL
|
bSetSelection = (infoPtr->selectedItem != NULL
|
||||||
|
@ -3153,9 +3153,11 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||||
|
|
||||||
if (bRemoveChildren)
|
if (bRemoveChildren)
|
||||||
{
|
{
|
||||||
|
INT old_cChildren = wineItem->cChildren;
|
||||||
TRACE("TVE_COLLAPSERESET\n");
|
TRACE("TVE_COLLAPSERESET\n");
|
||||||
wineItem->state &= ~TVIS_EXPANDEDONCE;
|
wineItem->state &= ~TVIS_EXPANDEDONCE;
|
||||||
TREEVIEW_RemoveAllChildren(infoPtr, wineItem);
|
TREEVIEW_RemoveAllChildren(infoPtr, wineItem);
|
||||||
|
wineItem->cChildren = old_cChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wineItem->firstChild)
|
if (wineItem->firstChild)
|
||||||
|
|
Loading…
Reference in New Issue