When a tabctrl has the ownerdraw style , it must not deflate the rectangle to account the padding. This fixes the tab drawing in emule (yes again :). I have tested this behavior against win 2k/xp. a+ Max ChangeLog: * Fix bounding rectangle computation for an ownerdraw tab.
Index: wine/dlls/comctl32/tab.c =================================================================== RCS file: /home/wine/wine/dlls/comctl32/tab.c,v retrieving revision 1.79 diff -u -r1.79 tab.c --- wine/dlls/comctl32/tab.c 27 Apr 2003 20:34:30 -0000 1.79 +++ wine/dlls/comctl32/tab.c 28 Apr 2003 11:20:32 -0000 @@ -1488,14 +1488,6 @@ SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? comctl32_color.clrHighlight : comctl32_color.clrBtnText); - /* - * Deflate the rectangle to acount for the padding - */ - if(lStyle & TCS_VERTICAL) - InflateRect(drawRect, -infoPtr->uVItemPadding, -infoPtr->uHItemPadding); - else - InflateRect(drawRect, -infoPtr->uHItemPadding, -infoPtr->uVItemPadding); - /* * if owner draw, tell the owner to draw @@ -1517,13 +1509,14 @@ dis.CtlID = id; dis.itemID = iItem; dis.itemAction = ODA_DRAWENTIRE; + dis.itemState = 0; if ( iItem == infoPtr->iSelected ) - dis.itemState = ODS_SELECTED; - else - dis.itemState = 0; + dis.itemState |= ODS_SELECTED; + if (infoPtr->uFocus == iItem) + dis.itemState |= ODS_FOCUS; dis.hwndItem = hwnd; /* */ dis.hDC = hdc; - dis.rcItem = *drawRect; /* */ + CopyRect(&dis.rcItem,drawRect); dis.itemData = infoPtr->items[iItem].lParam; /* @@ -1549,6 +1542,14 @@ /* used to center the icon and text in the tab */ RECT rcText; INT center_offset; + + /* + * Deflate the rectangle to acount for the padding + */ + if(lStyle & TCS_VERTICAL) + InflateRect(drawRect, -infoPtr->uVItemPadding, -infoPtr->uHItemPadding); + else + InflateRect(drawRect, -infoPtr->uHItemPadding, -infoPtr->uVItemPadding); /* set rcImage to drawRect, we will use top & left in our ImageList_Draw call */ rcImage = *drawRect;