mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[COMCTL32] -Fix some tests regarding how the v6 buttons gets repainted.
svn path=/trunk/; revision=74149
This commit is contained in:
parent
395c541573
commit
301c476074
2 changed files with 21 additions and 16 deletions
|
@ -508,30 +508,35 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
|
||||||
case WM_THEMECHANGED:
|
case WM_THEMECHANGED:
|
||||||
CloseThemeData (GetWindowTheme(hWnd));
|
CloseThemeData (GetWindowTheme(hWnd));
|
||||||
OpenThemeData(hWnd, WC_BUTTONW);
|
OpenThemeData(hWnd, WC_BUTTONW);
|
||||||
InvalidateRect(hWnd, NULL, FALSE);
|
InvalidateRect(hWnd, NULL, TRUE);
|
||||||
break;
|
break;
|
||||||
case WM_MOUSEHOVER:
|
|
||||||
{
|
|
||||||
int state = (int)SendMessageW(hWnd, BM_GETSTATE, 0, 0);
|
|
||||||
set_button_state(hWnd, state|BST_HOT);
|
|
||||||
InvalidateRect(hWnd, NULL, FALSE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case WM_MOUSELEAVE:
|
case WM_MOUSELEAVE:
|
||||||
{
|
{
|
||||||
int state = (int)SendMessageW(hWnd, BM_GETSTATE, 0, 0);
|
state = get_button_state( hWnd );
|
||||||
set_button_state(hWnd, state&(~BST_HOT));
|
if (state & BST_HOT)
|
||||||
InvalidateRect(hWnd, NULL, FALSE);
|
{
|
||||||
|
state &= ~BST_HOT;
|
||||||
|
set_button_state(hWnd, state);
|
||||||
|
InvalidateRect(hWnd, NULL, TRUE);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
TRACKMOUSEEVENT mouse_event;
|
TRACKMOUSEEVENT mouse_event;
|
||||||
|
state = get_button_state( hWnd );
|
||||||
|
if ((state & BST_HOT) == 0)
|
||||||
|
{
|
||||||
|
state |= BST_HOT;
|
||||||
|
set_button_state(hWnd, state);
|
||||||
|
InvalidateRect(hWnd, NULL, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
mouse_event.cbSize = sizeof(TRACKMOUSEEVENT);
|
mouse_event.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||||
mouse_event.dwFlags = TME_QUERY;
|
mouse_event.dwFlags = TME_QUERY;
|
||||||
if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&(TME_HOVER|TME_LEAVE)))
|
if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&TME_LEAVE))
|
||||||
{
|
{
|
||||||
mouse_event.dwFlags = TME_HOVER|TME_LEAVE;
|
mouse_event.dwFlags = TME_LEAVE;
|
||||||
mouse_event.hwndTrack = hWnd;
|
mouse_event.hwndTrack = hWnd;
|
||||||
mouse_event.dwHoverTime = 1;
|
mouse_event.dwHoverTime = 1;
|
||||||
TrackMouseEvent(&mouse_event);
|
TrackMouseEvent(&mouse_event);
|
||||||
|
|
|
@ -117,7 +117,7 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
GetClientRect(hwnd, &bgRect);
|
GetClientRect(hwnd, &bgRect);
|
||||||
GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect);
|
GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect);
|
||||||
|
|
||||||
if (prfFlag == 0 || (prfFlag & PRF_ERASEBKGND))
|
if (prfFlag == 0)
|
||||||
{
|
{
|
||||||
if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
|
if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
|
@ -216,7 +216,7 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
bgRect.right = bgRect.left + sz.cx;
|
bgRect.right = bgRect.left + sz.cx;
|
||||||
textRect.left = bgRect.right + 6;
|
textRect.left = bgRect.right + 6;
|
||||||
|
|
||||||
if (prfFlag == 0 || (prfFlag & PRF_ERASEBKGND))
|
if (prfFlag == 0)
|
||||||
{
|
{
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect, &contentRect);
|
GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect, &contentRect);
|
||||||
ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right, contentRect.bottom);
|
ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right, contentRect.bottom);
|
||||||
|
|
||||||
if (prfFlag == 0 || (prfFlag & PRF_ERASEBKGND))
|
if (prfFlag == 0)
|
||||||
{
|
{
|
||||||
if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
|
if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
|
|
Loading…
Reference in a new issue