TREEVIEW_UpdateScrollBars() now copes with an empty tree.
This commit is contained in:
parent
d4fcc4bd06
commit
292d8429ab
|
@ -2690,14 +2690,23 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
|||
if (vert)
|
||||
{
|
||||
si.nPage = TREEVIEW_GetVisibleCount(infoPtr);
|
||||
si.nPos = infoPtr->firstVisible->visibleOrder;
|
||||
si.nMax = infoPtr->maxVisibleOrder - 1;
|
||||
if ( si.nPage )
|
||||
{
|
||||
si.nPos = infoPtr->firstVisible->visibleOrder;
|
||||
si.nMax = infoPtr->maxVisibleOrder - 1;
|
||||
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
|
||||
|
||||
if (!(infoPtr->uInternalStatus & TV_VSCROLL))
|
||||
ShowScrollBar(hwnd, SB_VERT, TRUE);
|
||||
infoPtr->uInternalStatus |= TV_VSCROLL;
|
||||
if (!(infoPtr->uInternalStatus & TV_VSCROLL))
|
||||
ShowScrollBar(hwnd, SB_VERT, TRUE);
|
||||
infoPtr->uInternalStatus |= TV_VSCROLL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (infoPtr->uInternalStatus & TV_VSCROLL)
|
||||
ShowScrollBar(hwnd, SB_VERT, FALSE);
|
||||
infoPtr->uInternalStatus &= ~TV_VSCROLL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue