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) ...@@ -1546,6 +1546,8 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
SendMessageA (hwnd, TB_SETBUTTONSIZE, 0, SendMessageA (hwnd, TB_SETBUTTONSIZE, 0,
MAKELPARAM((WORD)22, (WORD)22)); MAKELPARAM((WORD)22, (WORD)22));
} }
TOOLBAR_CalcToolbar (hwnd);
} }
else else
{ {
...@@ -1717,6 +1719,8 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1717,6 +1719,8 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
} }
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return TRUE; return TRUE;
...@@ -1777,6 +1781,8 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1777,6 +1781,8 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
} }
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return TRUE; return TRUE;
...@@ -1995,6 +2001,7 @@ TOOLBAR_AutoSize (HWND hwnd) ...@@ -1995,6 +2001,7 @@ TOOLBAR_AutoSize (HWND hwnd)
} }
else { else {
infoPtr->nWidth = parent_rect.right - parent_rect.left; infoPtr->nWidth = parent_rect.right - parent_rect.left;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect( hwnd, NULL, TRUE ); InvalidateRect( hwnd, NULL, TRUE );
cy = infoPtr->nHeight; cy = infoPtr->nHeight;
cx = infoPtr->nWidth; cx = infoPtr->nWidth;
...@@ -2226,6 +2233,8 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -2226,6 +2233,8 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons); COMCTL32_Free (oldButtons);
} }
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, TRUE); InvalidateRect (hwnd, NULL, TRUE);
return TRUE; return TRUE;
...@@ -2716,6 +2725,8 @@ TOOLBAR_HideButton (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -2716,6 +2725,8 @@ TOOLBAR_HideButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
else else
btnPtr->fsState |= TBSTATE_HIDDEN; btnPtr->fsState |= TBSTATE_HIDDEN;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, TRUE); InvalidateRect (hwnd, NULL, TRUE);
return TRUE; return TRUE;
...@@ -2836,6 +2847,8 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -2836,6 +2847,8 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons); COMCTL32_Free (oldButtons);
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (hwnd, NULL, FALSE); InvalidateRect (hwnd, NULL, FALSE);
return TRUE; return TRUE;
...@@ -3399,6 +3412,7 @@ TOOLBAR_SetIndent (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -3399,6 +3412,7 @@ TOOLBAR_SetIndent (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nIndent != (INT)wParam) if(infoPtr->nIndent != (INT)wParam)
{ {
infoPtr->nIndent = (INT)wParam; infoPtr->nIndent = (INT)wParam;
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
} }
...@@ -3472,6 +3486,9 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -3472,6 +3486,9 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
infoPtr->nRows = LOWORD(wParam); infoPtr->nRows = LOWORD(wParam);
/* recalculate toolbar */
TOOLBAR_CalcToolbar (hwnd);
/* repaint toolbar */ /* repaint toolbar */
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
} }
...@@ -3638,6 +3655,9 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -3638,6 +3655,9 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
} }
} }
TOOLBAR_CalcToolbar(hwnd);
return 0; return 0;
} }
...@@ -4122,8 +4142,6 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam) ...@@ -4122,8 +4142,6 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam)
TRACE("\n"); TRACE("\n");
TOOLBAR_CalcToolbar( hwnd );
/* fill ps.rcPaint with a default rect */ /* fill ps.rcPaint with a default rect */
memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound)); 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