TREEVIEW_UpdateScrollBars() now copes with an empty tree.

oldstable
Adam Gundy 2003-03-06 22:41:59 +00:00 committed by Alexandre Julliard
parent d4fcc4bd06
commit 292d8429ab
1 changed files with 15 additions and 6 deletions

View File

@ -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
{