Commit f730157c authored by Duane Clark's avatar Duane Clark Committed by Alexandre Julliard

Test bUnicode and call appropriate DrawText routine.

parent c6adc368
...@@ -158,7 +158,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack) ...@@ -158,7 +158,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
RECT r; RECT r;
INT oldBkMode; INT oldBkMode;
TRACE("DrawItem(iItem %d bHotTrack %d)\n", iItem, bHotTrack); TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, infoPtr->bUnicode);
if (!infoPtr->bRectsValid) if (!infoPtr->bRectsValid)
HEADER_SetItemBounds(hwnd); HEADER_SetItemBounds(hwnd);
...@@ -253,7 +253,11 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack) ...@@ -253,7 +253,11 @@ 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;
DrawTextW (hdc, phdi->pszText, -1, if (infoPtr->bUnicode)
DrawTextW (hdc, phdi->pszText, -1,
&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); &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;
...@@ -310,7 +314,11 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack) ...@@ -310,7 +314,11 @@ 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);
DrawTextW (hdc, phdi->pszText, -1, if (infoPtr->bUnicode)
DrawTextW (hdc, phdi->pszText, -1,
&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); &r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
if (oldBkMode != TRANSPARENT) if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode); SetBkMode(hdc, oldBkMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment