Commit 8b562997 authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Only call TOOLBAR_CalcToolbar when parameters change.

parent 74620998
......@@ -1546,6 +1546,8 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
SendMessageA (hwnd, TB_SETBUTTONSIZE, 0,
MAKELPARAM((WORD)22, (WORD)22));
}
TOOLBAR_CalcToolbar (hwnd);
}
else
{
......@@ -1717,6 +1719,8 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
......@@ -1777,6 +1781,8 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
......@@ -1995,6 +2001,7 @@ TOOLBAR_AutoSize (HWND hwnd)
}
else {
infoPtr->nWidth = parent_rect.right - parent_rect.left;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect( hwnd, NULL, TRUE );
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
......@@ -2226,6 +2233,8 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons);
}
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, TRUE);
return TRUE;
......@@ -2716,6 +2725,8 @@ TOOLBAR_HideButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
btnPtr->fsState |= TBSTATE_HIDDEN;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, TRUE);
return TRUE;
......@@ -2836,6 +2847,8 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons);
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, FALSE);
return TRUE;
......@@ -3399,6 +3412,7 @@ TOOLBAR_SetIndent (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nIndent != (INT)wParam)
{
infoPtr->nIndent = (INT)wParam;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
}
......@@ -3472,6 +3486,9 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
infoPtr->nRows = LOWORD(wParam);
/* recalculate toolbar */
TOOLBAR_CalcToolbar (hwnd);
/* repaint toolbar */
InvalidateRect(hwnd, NULL, FALSE);
}
......@@ -3638,6 +3655,9 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
}
}
TOOLBAR_CalcToolbar(hwnd);
return 0;
}
......@@ -4122,8 +4142,6 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam)
TRACE("\n");
TOOLBAR_CalcToolbar( hwnd );
/* fill ps.rcPaint with a default rect */
memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment