Fixed win9x look on checkboxes and radiobuttons.
This commit is contained in:
parent
304d9a4737
commit
9af3ebaa7b
|
@ -679,6 +679,8 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
|
|||
if (wndPtr->text) textlen = strlen( wndPtr->text );
|
||||
if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
|
||||
{
|
||||
if( TWEAK_WineLook == WIN31_LOOK )
|
||||
{
|
||||
HDC hMemDC = CreateCompatibleDC( hDC );
|
||||
int x = 0, y = 0;
|
||||
delta = (rbox.bottom - rbox.top - checkBoxHeight) / 2;
|
||||
|
@ -705,6 +707,25 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
|
|||
BitBlt( hDC, rbox.left, rbox.top + delta, checkBoxWidth,
|
||||
checkBoxHeight, hMemDC, x, y, SRCCOPY );
|
||||
DeleteDC( hMemDC );
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT state;
|
||||
|
||||
if (((wndPtr->dwStyle & 0x0f) == BS_RADIOBUTTON) ||
|
||||
((wndPtr->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) state = DFCS_BUTTONRADIO;
|
||||
else if (infoPtr->state & BUTTON_3STATE) state = DFCS_BUTTON3STATE;
|
||||
else state = DFCS_BUTTONCHECK;
|
||||
|
||||
if (infoPtr->state & (BUTTON_CHECKED | BUTTON_3STATE)) state |= DFCS_CHECKED;
|
||||
|
||||
if (infoPtr->state & BUTTON_HIGHLIGHTED) state |= DFCS_PUSHED;
|
||||
|
||||
if (wndPtr->dwStyle & WS_DISABLED) state |= DFCS_INACTIVE;
|
||||
|
||||
DrawFrameControl( hDC, &rbox, DFC_BUTTON, state );
|
||||
}
|
||||
|
||||
|
||||
if( textlen && action != ODA_SELECT )
|
||||
{
|
||||
|
|
|
@ -616,6 +616,29 @@ static int UITOOLS_MakeSquareRect(LPRECT src, LPRECT dst)
|
|||
return SmallDiam;
|
||||
}
|
||||
|
||||
static void UITOOLS_DrawCheckedRect( HDC dc, LPRECT rect )
|
||||
{
|
||||
if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255))
|
||||
{
|
||||
HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55);
|
||||
HBRUSH hbsave;
|
||||
HBRUSH hb = CreatePatternBrush(hbm);
|
||||
COLORREF bg;
|
||||
|
||||
FillRect(dc, rect, GetSysColorBrush(COLOR_BTNFACE));
|
||||
bg = SetBkColor(dc, RGB(255, 255, 255));
|
||||
hbsave = (HBRUSH)SelectObject(dc, hb);
|
||||
PatBlt(dc, rect->left, rect->top, rect->right-rect->left, rect->bottom-rect->top, 0x00FA0089);
|
||||
SelectObject(dc, hbsave);
|
||||
SetBkColor(dc, bg);
|
||||
DeleteObject(hb);
|
||||
DeleteObject(hbm);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRect(dc, rect, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* UITOOLS_DFC_ButtonPush
|
||||
|
@ -643,26 +666,10 @@ static BOOL UITOOLS95_DFC_ButtonPush(HDC dc, LPRECT r, UINT uFlags)
|
|||
else
|
||||
UITOOLS95_DrawRectEdge(dc, &myr, edge, (uFlags&DFCS_FLAT)|BF_RECT|BF_SOFT|BF_ADJUST);
|
||||
|
||||
if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255))
|
||||
{
|
||||
HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55);
|
||||
HBRUSH hbsave;
|
||||
HBRUSH hb = CreatePatternBrush(hbm);
|
||||
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNFACE));
|
||||
hbsave = (HBRUSH)SelectObject(dc, hb);
|
||||
PatBlt(dc, myr.left, myr.top, myr.right-myr.left, myr.bottom-myr.top, 0x00FA0089);
|
||||
SelectObject(dc, hbsave);
|
||||
DeleteObject(hb);
|
||||
DeleteObject(hbm);
|
||||
UITOOLS_DrawCheckedRect( dc, &myr );
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(uFlags & DFCS_MONO)
|
||||
{
|
||||
UITOOLS95_DrawRectEdge(dc, &myr, edge, BF_MONO|BF_RECT|BF_ADJUST);
|
||||
|
@ -702,61 +709,17 @@ static BOOL UITOOLS95_DFC_ButtonCheck(HDC dc, LPRECT r, UINT uFlags)
|
|||
{
|
||||
RECT myr;
|
||||
int SmallDiam = UITOOLS_MakeSquareRect(r, &myr);
|
||||
int BorderShrink = SmallDiam / 16;
|
||||
UINT flags = BF_RECT | BF_ADJUST;
|
||||
|
||||
if(BorderShrink < 1) BorderShrink = 1;
|
||||
if(uFlags & DFCS_FLAT) flags |= BF_FLAT;
|
||||
else if(uFlags & DFCS_MONO) flags |= BF_MONO;
|
||||
|
||||
/* FIXME: The FillRect() sequence doesn't work for sizes less than */
|
||||
/* 4 pixels in diameter. Not really a problem but it isn't M$'s */
|
||||
/* 100% equivalent. */
|
||||
if(uFlags & (DFCS_FLAT|DFCS_MONO))
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_WINDOWFRAME));
|
||||
myr.left += 2 * BorderShrink;
|
||||
myr.right -= 2 * BorderShrink;
|
||||
myr.top += 2 * BorderShrink;
|
||||
myr.bottom -= 2 * BorderShrink;
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
|
||||
myr.right -= BorderShrink;
|
||||
myr.bottom -= BorderShrink;
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNSHADOW));
|
||||
myr.left += BorderShrink;
|
||||
myr.top += BorderShrink;
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_3DLIGHT));
|
||||
myr.right -= BorderShrink;
|
||||
myr.bottom -= BorderShrink;
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_3DDKSHADOW));
|
||||
myr.left += BorderShrink;
|
||||
myr.top += BorderShrink;
|
||||
}
|
||||
UITOOLS95_DrawRectEdge( dc, &myr, EDGE_SUNKEN, flags );
|
||||
|
||||
if(uFlags & (DFCS_INACTIVE|DFCS_PUSHED))
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNFACE));
|
||||
}
|
||||
else if(uFlags & DFCS_CHECKED)
|
||||
{
|
||||
if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255))
|
||||
{
|
||||
HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55);
|
||||
HBRUSH hbsave;
|
||||
HBRUSH hb = CreatePatternBrush(hbm);
|
||||
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNFACE));
|
||||
hbsave = (HBRUSH)SelectObject(dc, hb);
|
||||
PatBlt(dc, myr.left, myr.top, myr.right-myr.left, myr.bottom-myr.top, 0x00FA0089);
|
||||
SelectObject(dc, hbsave);
|
||||
DeleteObject(hb);
|
||||
DeleteObject(hbm);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
|
||||
}
|
||||
}
|
||||
else if( (uFlags & DFCS_BUTTON3STATE) && (uFlags & DFCS_CHECKED) )
|
||||
UITOOLS_DrawCheckedRect( dc, &myr );
|
||||
else
|
||||
{
|
||||
FillRect(dc, &myr, GetSysColorBrush(COLOR_WINDOW));
|
||||
|
|
Loading…
Reference in New Issue