Fixed the look of the combobox's drop down button when in Win95 look.
This commit is contained in:
parent
85411af6ae
commit
28d2ccb07c
104
controls/combo.c
104
controls/combo.c
@ -659,56 +659,74 @@ static void CBPaintButton(
|
|||||||
HDC hdc,
|
HDC hdc,
|
||||||
RECT rectButton)
|
RECT rectButton)
|
||||||
{
|
{
|
||||||
UINT x, y;
|
|
||||||
BOOL bBool;
|
|
||||||
HDC hMemDC;
|
|
||||||
HBRUSH hPrevBrush;
|
|
||||||
COLORREF oldTextColor, oldBkColor;
|
|
||||||
|
|
||||||
if( lphc->wState & CBF_NOREDRAW )
|
if( lphc->wState & CBF_NOREDRAW )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE));
|
if (TWEAK_WineLook == WIN31_LOOK)
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 );
|
UINT x, y;
|
||||||
}
|
BOOL bBool;
|
||||||
else
|
HDC hMemDC;
|
||||||
{
|
HBRUSH hPrevBrush;
|
||||||
DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT );
|
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;
|
||||||
|
|
||||||
/*
|
if (lphc->wState & CBF_BUTTONDOWN)
|
||||||
* Remove the edge of the button from the rectangle
|
{
|
||||||
* and calculate the position of the bitmap.
|
buttonState |= DFCS_PUSHED;
|
||||||
*/
|
}
|
||||||
InflateRect( &rectButton, -2, -2);
|
|
||||||
|
|
||||||
x = (rectButton.left + rectButton.right - CBitWidth) >> 1;
|
DrawFrameControl(hdc,
|
||||||
y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1;
|
&rectButton,
|
||||||
|
DFC_SCROLL,
|
||||||
|
buttonState);
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user