From 5aa9754c6aa21967712bd898068c5d4ea3bad034 Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Tue, 17 Jul 2001 00:39:15 +0000 Subject: [PATCH] Refresh bitmap count to take in account imagelist changes after TB_SETIMAGELIST. --- dlls/comctl32/toolbar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 1bf3df848f9..ddc1a3e90f3 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -226,9 +226,6 @@ TOOLBAR_DrawString (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, rcText.top += infoPtr->nBitmapHeight; } } - else { - rcText.top += infoPtr->nBitmapHeight; - } if (nState & (TBSTATE_PRESSED | TBSTATE_CHECKED)) OffsetRect (&rcText, 1, 1); @@ -505,6 +502,10 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps) INT i; RECT rcTemp; + /* if imagelist belongs to the app, it can be changed + by the app after setting it */ + if (infoPtr->himlDef != infoPtr->himlInt) + infoPtr->nNumBitmaps = ImageList_GetImageCount(infoPtr->himlDef); /* redraw necessary buttons */ btnPtr = infoPtr->buttons; for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)