*/
static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
{
- RECT rc, focus_rect, r;
+ RECT rc, r;
UINT dtFlags, uState;
HPEN hOldPen;
HBRUSH hOldBrush;
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
InflateRect( &rc, -1, -1 );
}
-
- focus_rect = rc;
/* completely skip the drawing if only focus has changed */
if (action == ODA_FOCUS) goto draw_focus;
- uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
+ uState = DFCS_BUTTONPUSH;
if (style & BS_FLAT)
uState |= DFCS_MONO;
if (pushedState)
OffsetRect(&r, 1, 1);
- IntersectClipRect(hDC, rc.left, rc.top, rc.right, rc.bottom);
-
oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) );
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r);
{
if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS))
{
- InflateRect( &focus_rect, -1, -1 );
- IntersectRect(&focus_rect, &focus_rect, &rc);
- DrawFocusRect( hDC, &focus_rect );
+ InflateRect( &rc, -2, -2 );
+ DrawFocusRect( hDC, &rc );
}
}
/***********************************************************************
* MenuExitTracking
*/
-static BOOL FASTCALL MenuExitTracking(HWND hWnd)
+static BOOL FASTCALL MenuExitTracking(HWND hWnd, BOOL bPopup)
{
TRACE("hwnd=%p\n", hWnd);
- SendMessageW( hWnd, WM_EXITMENULOOP, 0, 0 );
+ SendMessageW( hWnd, WM_EXITMENULOOP, bPopup, 0 );
ShowCaret(0);
top_popup = 0;
top_popup_hmenu = NULL;
MenuInitTracking(hWnd, hMenu, FALSE, wFlags);
MenuTrackMenu(hMenu, wFlags, pt.x, pt.y, hWnd, NULL);
- MenuExitTracking(hWnd);
+ MenuExitTracking(hWnd, FALSE);
}
}
track_menu:
MenuTrackMenu( hTrackMenu, wFlags, 0, 0, hwnd, NULL );
- MenuExitTracking( hwnd );
+ MenuExitTracking( hwnd, FALSE );
}
if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 ))
ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd,
Tpm ? &Tpm->rcExclude : NULL);
- MenuExitTracking(Wnd);
+ MenuExitTracking(Wnd, TRUE);
return ret;
}