From 1db182f20b827e0722839d233abc67fa6785556e Mon Sep 17 00:00:00 2001 From: Serge Ivanov Date: Sat, 15 Apr 2000 20:36:15 +0000 Subject: [PATCH] Added proper handling TVIS_OVERLAYMASK flag and allows to display overlay images. Fixed off by one error with listitem in TREEVIEW_InsertItemA (uNumItems is 0 based, cChildren is a count). --- dlls/comctl32/treeview.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index dc15b3520e9..e7f8c28fd42 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -757,13 +757,18 @@ TREEVIEW_DrawItem (HWND hwnd, HDC hdc, TREEVIEW_ITEM *wineItem) if (himlp) { - ImageList_Draw ( *himlp, imageIndex, hdc, xpos-2, r.top+1, ILD_NORMAL); - ImageList_GetIconSize (*himlp, &cx, &cy); - wineItem->bitmap.left=xpos-2; - wineItem->bitmap.right=xpos-2+cx; - wineItem->bitmap.top=r.top+1; - wineItem->bitmap.bottom=r.top+1+cy; - xpos+=cx; + int ovlIdx = 0; + + if(wineItem->stateMask & TVIS_OVERLAYMASK) + ovlIdx = wineItem->state & TVIS_OVERLAYMASK; + + ImageList_Draw ( *himlp, imageIndex, hdc, xpos-2, r.top+1, ILD_NORMAL|ovlIdx); + ImageList_GetIconSize (*himlp, &cx, &cy); + wineItem->bitmap.left=xpos-2; + wineItem->bitmap.right=xpos-2+cx; + wineItem->bitmap.top=r.top+1; + wineItem->bitmap.bottom=r.top+1+cy; + xpos+=cx; } } @@ -1773,8 +1778,8 @@ TREEVIEW_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) wineItem->parent = ptdi->hParent; sibItem = &infoPtr->items [(INT)parentItem->firstChild]; - parentItem->cChildren++; listItems = parentItem->cChildren; + parentItem->cChildren++; } @@ -1814,7 +1819,7 @@ TREEVIEW_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) wineItem->firstChild=0; wineItem->hItem=(HTREEITEM)iItem; - if (listItems>1) { + if (listItems!=0) { prevsib=NULL; switch ((DWORD) ptdi->hInsertAfter) { -- 2.11.4.GIT