diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index a72d443bf5eaa8aad6fd5f07c35a03f057b8e23f..7e20ed2599f16c9f46118a631be0408187c46f50 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -601,6 +601,10 @@ static void TAB_SetupScrolling( */ if (infoPtr->hwndUpDown==0) { + /* + * I use a scrollbar since it seems to be more stable than the Updown + * control. + */ infoPtr->hwndUpDown = CreateWindowA("msctls_updown32", "", WS_VISIBLE | WS_CHILD | UDS_HORZ, @@ -816,6 +820,10 @@ static void TAB_SetItemBounds (HWND hwnd) infoPtr->needsScrolling = (curItemLeftPos + (2*SELECTED_TAB_OFFSET) > clientRect.right); + /* Don't need scrolling, then update infoPtr->leftmostVisible */ + if(!infoPtr->needsScrolling) + infoPtr->leftmostVisible = 0; + TAB_SetupScrolling(hwnd, infoPtr, &clientRect); } @@ -1314,8 +1322,8 @@ static void TAB_Refresh (HWND hwnd, HDC hdc) * If we haven't set the current focus yet, set it now. * Only happens when we first paint the tab controls. */ - if (infoPtr->uFocus == -1) - TAB_SetCurFocus(hwnd, infoPtr->iSelected); + if (infoPtr->uFocus == -1) + TAB_SetCurFocus(hwnd, infoPtr->iSelected); } SelectObject (hdc, hOldFont); @@ -1555,12 +1563,12 @@ TAB_InsertItem (HWND hwnd, WPARAM wParam, LPARAM lParam) if (pti->mask & TCIF_PARAM) infoPtr->items[iItem].lParam = pti->lParam; + TAB_SetItemBounds(hwnd); TAB_InvalidateTabArea(hwnd, infoPtr); TRACE("[%04x]: added item %d '%s'\n", hwnd, iItem, infoPtr->items[iItem].pszText); - TAB_SetItemBounds(hwnd); return iItem; } @@ -2111,7 +2119,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) default: if (uMsg >= WM_USER) - ERR("unknown msg %04x wp=%08x lp=%08lx\n", + WARN("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam); return DefWindowProcA (hwnd, uMsg, wParam, lParam); }