pszText is stored as Unicode, so call DrawTextW() instead of

DrawTextA().
This commit is contained in:
Martin Fuchs 2002-10-18 00:20:04 +00:00 committed by Alexandre Julliard
parent c18c7332b8
commit fe7d46a221
1 changed files with 6 additions and 14 deletions

View File

@ -254,12 +254,8 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
GetObjectA (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp); GetObjectA (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
textRect = r; textRect = r;
if (infoPtr->bUnicode)
DrawTextW (hdc, phdi->pszText, -1, DrawTextW (hdc, phdi->pszText, -1,
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT); &textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
else
DrawTextA (hdc, (LPCSTR)phdi->pszText, -1,
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
tx = textRect.right - textRect.left; tx = textRect.right - textRect.left;
ry = r.bottom - r.top; ry = r.bottom - r.top;
rx = r.right - r.left; rx = r.right - r.left;
@ -315,12 +311,8 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
r.left += 3 ; r.left += 3 ;
r.right -= 3; r.right -= 3;
SetTextColor (hdc, (bHotTrack) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT); SetTextColor (hdc, (bHotTrack) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
if (infoPtr->bUnicode)
DrawTextW (hdc, phdi->pszText, -1, DrawTextW (hdc, phdi->pszText, -1,
&r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE); &r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
else
DrawTextA (hdc, (LPCSTR)phdi->pszText, -1,
&r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
if (oldBkMode != TRANSPARENT) if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode); SetBkMode(hdc, oldBkMode);
} }