From 28d2ccb07ca468bbc2573dd6c424a4c92a7f83bd Mon Sep 17 00:00:00 2001 From: Francis Beaudet Date: Sat, 14 Aug 1999 15:51:49 +0000 Subject: [PATCH] Fixed the look of the combobox's drop down button when in Win95 look. --- controls/combo.c | 104 +++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index d4daf140d58..86c5e0ee08f 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -659,56 +659,74 @@ static void CBPaintButton( HDC hdc, RECT rectButton) { - UINT x, y; - BOOL bBool; - HDC hMemDC; - HBRUSH hPrevBrush; - COLORREF oldTextColor, oldBkColor; - if( lphc->wState & CBF_NOREDRAW ) return; - hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE)); - - /* - * Draw the button background - */ - PatBlt( hdc, - rectButton.left, - rectButton.top, - rectButton.right-rectButton.left, - rectButton.bottom-rectButton.top, - PATCOPY ); - - if( (bBool = lphc->wState & CBF_BUTTONDOWN) ) + if (TWEAK_WineLook == WIN31_LOOK) { - DrawEdge( hdc, &rectButton, EDGE_SUNKEN, BF_RECT ); - } - else - { - DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT ); + UINT x, y; + BOOL bBool; + HDC hMemDC; + HBRUSH hPrevBrush; + COLORREF oldTextColor, oldBkColor; + + + hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE)); + + /* + * Draw the button background + */ + PatBlt( hdc, + rectButton.left, + rectButton.top, + rectButton.right-rectButton.left, + rectButton.bottom-rectButton.top, + PATCOPY ); + + if( (bBool = lphc->wState & CBF_BUTTONDOWN) ) + { + DrawEdge( hdc, &rectButton, EDGE_SUNKEN, BF_RECT ); + } + else + { + DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT ); + } + + /* + * Remove the edge of the button from the rectangle + * and calculate the position of the bitmap. + */ + InflateRect( &rectButton, -2, -2); + + x = (rectButton.left + rectButton.right - CBitWidth) >> 1; + y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1; + + + hMemDC = CreateCompatibleDC( hdc ); + SelectObject( hMemDC, hComboBmp ); + oldTextColor = SetTextColor( hdc, GetSysColor(COLOR_BTNFACE) ); + oldBkColor = SetBkColor( hdc, CB_DISABLED(lphc) ? RGB(128,128,128) : + RGB(0,0,0) ); + BitBlt( hdc, x, y, CBitWidth, CBitHeight, hMemDC, 0, 0, SRCCOPY ); + SetBkColor( hdc, oldBkColor ); + SetTextColor( hdc, oldTextColor ); + DeleteDC( hMemDC ); + SelectObject( hdc, hPrevBrush ); } + else + { + UINT buttonState = DFCS_SCROLLCOMBOBOX; - /* - * Remove the edge of the button from the rectangle - * and calculate the position of the bitmap. - */ - InflateRect( &rectButton, -2, -2); + if (lphc->wState & CBF_BUTTONDOWN) + { + buttonState |= DFCS_PUSHED; + } - x = (rectButton.left + rectButton.right - CBitWidth) >> 1; - y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1; - - - hMemDC = CreateCompatibleDC( hdc ); - SelectObject( hMemDC, hComboBmp ); - oldTextColor = SetTextColor( hdc, GetSysColor(COLOR_BTNFACE) ); - oldBkColor = SetBkColor( hdc, CB_DISABLED(lphc) ? RGB(128,128,128) : - RGB(0,0,0) ); - BitBlt( hdc, x, y, CBitWidth, CBitHeight, hMemDC, 0, 0, SRCCOPY ); - SetBkColor( hdc, oldBkColor ); - SetTextColor( hdc, oldTextColor ); - DeleteDC( hMemDC ); - SelectObject( hdc, hPrevBrush ); + DrawFrameControl(hdc, + &rectButton, + DFC_SCROLL, + buttonState); + } } /***********************************************************************