From 4d975b328f98324872bbdc9838a5f7b14d5e81d1 Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Tue, 12 Dec 2000 00:35:20 +0000 Subject: [PATCH] Use DrawText to display text in horizontal tabs. --- dlls/comctl32/tab.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 66a41429a5c..f30d796deaf 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -1431,7 +1431,7 @@ TAB_DrawItemInterior /* get the rectangle that the text fits in */ DrawTextW(hdc, infoPtr->items[iItem].pszText, -1, &rcText, DT_CALCRECT); - + rcText.right += 4; /* * If not owner draw, then do the drawing ourselves. * @@ -1536,15 +1536,28 @@ TAB_DrawItemInterior hOldFont = SelectObject(hdc, hFont); } - ExtTextOutW(hdc, - ((lStyle & TCS_VERTICAL) && (lStyle & TCS_BOTTOM)) ? drawRect->right : drawRect->left, - ((lStyle & TCS_VERTICAL) && !(lStyle & TCS_BOTTOM)) ? drawRect->bottom : drawRect->top, - 0, - 0, - infoPtr->items[iItem].pszText, - lstrlenW(infoPtr->items[iItem].pszText), - 0); - + if (lStyle & TCS_VERTICAL) + { + ExtTextOutW(hdc, + (lStyle & TCS_BOTTOM) ? drawRect->right : drawRect->left, + (!(lStyle & TCS_BOTTOM)) ? drawRect->bottom : drawRect->top, + 0, + 0, + infoPtr->items[iItem].pszText, + lstrlenW(infoPtr->items[iItem].pszText), + 0); + } + else + { + DrawTextW + ( + hdc, + infoPtr->items[iItem].pszText, + lstrlenW(infoPtr->items[iItem].pszText), + drawRect, + uHorizAlign | DT_SINGLELINE + ); + } /* clean things up */ *drawRect = rcTemp; /* restore drawRect */