dll/win32/comctl32/listbox.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dll/win32/comctl32/listbox.c b/dll/win32/comctl32/listbox.c index e2fa2ef9dc5..0cc42209e21 100644 --- a/dll/win32/comctl32/listbox.c +++ b/dll/win32/comctl32/listbox.c @@ -676,6 +676,13 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, oldBk = SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); oldText = SetTextColor( hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); } +#ifdef __REACTOS__ + else + { + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, rect, br); + } +#endif TRACE("[%p]: painting %d (%s) action=%02x rect=%s\n", descr->self, index, debugstr_w(item_str), action, @@ -684,9 +691,24 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL ); else if (!(descr->style & LBS_USETABSTOPS)) +#ifdef __REACTOS__ + { + RECT rc = *rect; + if (!selected) + { + SIZE sz; + GetTextExtentPoint32(hdc, item_str, lstrlenW(item_str), &sz); + rc.right = min(sz.cx, rc.right); + } + ExtTextOutW( hdc, rect->left + 1, rect->top, + ETO_OPAQUE | ETO_CLIPPED, &rc, item_str, + lstrlenW(item_str), NULL); + } +#else ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, item_str, lstrlenW(item_str), NULL ); +#endif else { /* Output empty string to paint background in the full width. */ @@ -1173,8 +1195,13 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) if (rect.top < descr->height) { rect.bottom = descr->height; +#ifdef __REACTOS__ + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, &rect, br); +#else ExtTextOutW( hdc, 0, 0, ETO_OPAQUE | ETO_CLIPPED, &rect, NULL, 0, NULL ); +#endif } if (rect.right < descr->width) { @@ -1182,8 +1209,13 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) rect.right = descr->width; rect.top = 0; rect.bottom = descr->height; +#ifdef __REACTOS__ + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, &rect, br); +#else ExtTextOutW( hdc, 0, 0, ETO_OPAQUE | ETO_CLIPPED, &rect, NULL, 0, NULL ); +#endif } } if (oldFont) SelectObject( hdc, oldFont ); win32ss/user/user32/controls/listbox.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/win32ss/user/user32/controls/listbox.c b/win32ss/user/user32/controls/listbox.c index 3d98ac3822f..1f0dc081deb 100644 --- a/win32ss/user/user32/controls/listbox.c +++ b/win32ss/user/user32/controls/listbox.c @@ -585,6 +585,13 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, oldBk = SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); oldText = SetTextColor( hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); } +#ifdef __REACTOS__ + else + { + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, rect, br); + } +#endif TRACE("[%p]: painting %d (%s) action=%02x rect=%s\n", descr->self, index, item ? debugstr_w(item->str) : "", action, @@ -593,9 +600,24 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL ); else if (!(descr->style & LBS_USETABSTOPS)) +#ifdef __REACTOS__ + { + RECT rc = *rect; + if (!item->selected) + { + SIZE sz; + GetTextExtentPoint32(hdc, item->str, strlenW(item->str), &sz); + rc.right = min(sz.cx, rc.right); + } + ExtTextOutW( hdc, rect->left + 1, rect->top, + ETO_OPAQUE | ETO_CLIPPED, &rc, item->str, + strlenW(item->str), NULL); + } +#else ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, item->str, strlenW(item->str), NULL ); +#endif else { /* Output empty string to paint background in the full width. */ @@ -1119,8 +1141,13 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) if (rect.top < descr->height) { rect.bottom = descr->height; +#ifdef __REACTOS__ + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, &rect, br); +#else ExtTextOutW( hdc, 0, 0, ETO_OPAQUE | ETO_CLIPPED, &rect, NULL, 0, NULL ); +#endif } if (rect.right < descr->width) { @@ -1128,8 +1155,13 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) rect.right = descr->width; rect.top = 0; rect.bottom = descr->height; +#ifdef __REACTOS__ + HBRUSH br = GetCurrentObject(hdc, OBJ_BRUSH); + FillRect(hdc, &rect, br); +#else ExtTextOutW( hdc, 0, 0, ETO_OPAQUE | ETO_CLIPPED, &rect, NULL, 0, NULL ); +#endif } } if (oldFont) SelectObject( hdc, oldFont );