Commit d2c9a5cf authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

comctl32: Improved setting button state.

parent f831f775
......@@ -246,18 +246,26 @@ static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC)
DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
ButtonState drawState = IsWindowEnabled(hwnd) ? STATE_NORMAL : STATE_DISABLED;
int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0);
ButtonState drawState;
pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
if (paint)
if(!paint)
return FALSE;
if(IsWindowEnabled(hwnd))
{
hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps);
paint(theme, hwnd, hDC, drawState, dtFlags);
if (!hParamDC) EndPaint(hwnd, &ps);
return TRUE;
if(state & BST_PUSHED) drawState = STATE_PRESSED;
else if(state & BST_HOT) drawState = STATE_HOT;
else if(state & BST_FOCUS) drawState = STATE_DEFAULTED;
else drawState = STATE_NORMAL;
}
else drawState = STATE_DISABLED;
return FALSE; /* Delegate drawing to the non-themed code. */
hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps);
paint(theme, hwnd, hDC, drawState, dtFlags);
if (!hParamDC) EndPaint(hwnd, &ps);
return TRUE;
}
/**********************************************************************
......
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