mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[User32]
- Dmitry Timoshkov : Do not ask DrawFrameControl() to modify the passed in rectangle. - Nikolay Sivov : Set WM_EXITMENULOOP wParam same way as for WM_ENTERMENULOOP. svn path=/trunk/; revision=46961
This commit is contained in:
parent
590cff7bd1
commit
b88a39e105
2 changed files with 9 additions and 14 deletions
|
@ -829,7 +829,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc)
|
||||||
*/
|
*/
|
||||||
static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
{
|
{
|
||||||
RECT rc, focus_rect, r;
|
RECT rc, r;
|
||||||
UINT dtFlags, uState;
|
UINT dtFlags, uState;
|
||||||
HPEN hOldPen;
|
HPEN hOldPen;
|
||||||
HBRUSH hOldBrush;
|
HBRUSH hOldBrush;
|
||||||
|
@ -865,13 +865,11 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
|
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
|
||||||
InflateRect( &rc, -1, -1 );
|
InflateRect( &rc, -1, -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
focus_rect = rc;
|
|
||||||
|
|
||||||
/* completely skip the drawing if only focus has changed */
|
/* completely skip the drawing if only focus has changed */
|
||||||
if (action == ODA_FOCUS) goto draw_focus;
|
if (action == ODA_FOCUS) goto draw_focus;
|
||||||
|
|
||||||
uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
|
uState = DFCS_BUTTONPUSH;
|
||||||
|
|
||||||
if (style & BS_FLAT)
|
if (style & BS_FLAT)
|
||||||
uState |= DFCS_MONO;
|
uState |= DFCS_MONO;
|
||||||
|
@ -898,8 +896,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
if (pushedState)
|
if (pushedState)
|
||||||
OffsetRect(&r, 1, 1);
|
OffsetRect(&r, 1, 1);
|
||||||
|
|
||||||
IntersectClipRect(hDC, rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) );
|
oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) );
|
||||||
|
|
||||||
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r);
|
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r);
|
||||||
|
@ -912,9 +908,8 @@ draw_focus:
|
||||||
{
|
{
|
||||||
if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS))
|
if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS))
|
||||||
{
|
{
|
||||||
InflateRect( &focus_rect, -1, -1 );
|
InflateRect( &rc, -2, -2 );
|
||||||
IntersectRect(&focus_rect, &focus_rect, &rc);
|
DrawFocusRect( hDC, &rc );
|
||||||
DrawFocusRect( hDC, &focus_rect );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3524,11 +3524,11 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* MenuExitTracking
|
* MenuExitTracking
|
||||||
*/
|
*/
|
||||||
static BOOL FASTCALL MenuExitTracking(HWND hWnd)
|
static BOOL FASTCALL MenuExitTracking(HWND hWnd, BOOL bPopup)
|
||||||
{
|
{
|
||||||
TRACE("hwnd=%p\n", hWnd);
|
TRACE("hwnd=%p\n", hWnd);
|
||||||
|
|
||||||
SendMessageW( hWnd, WM_EXITMENULOOP, 0, 0 );
|
SendMessageW( hWnd, WM_EXITMENULOOP, bPopup, 0 );
|
||||||
ShowCaret(0);
|
ShowCaret(0);
|
||||||
top_popup = 0;
|
top_popup = 0;
|
||||||
top_popup_hmenu = NULL;
|
top_popup_hmenu = NULL;
|
||||||
|
@ -3558,7 +3558,7 @@ VOID MenuTrackMouseMenuBar( HWND hWnd, ULONG ht, POINT pt)
|
||||||
|
|
||||||
MenuInitTracking(hWnd, hMenu, FALSE, wFlags);
|
MenuInitTracking(hWnd, hMenu, FALSE, wFlags);
|
||||||
MenuTrackMenu(hMenu, wFlags, pt.x, pt.y, hWnd, NULL);
|
MenuTrackMenu(hMenu, wFlags, pt.x, pt.y, hWnd, NULL);
|
||||||
MenuExitTracking(hWnd);
|
MenuExitTracking(hWnd, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3633,7 +3633,7 @@ VOID MenuTrackKbdMenuBar(HWND hwnd, UINT wParam, WCHAR wChar)
|
||||||
|
|
||||||
track_menu:
|
track_menu:
|
||||||
MenuTrackMenu( hTrackMenu, wFlags, 0, 0, hwnd, NULL );
|
MenuTrackMenu( hTrackMenu, wFlags, 0, 0, hwnd, NULL );
|
||||||
MenuExitTracking( hwnd );
|
MenuExitTracking( hwnd, FALSE );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3660,7 +3660,7 @@ BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y,
|
||||||
if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 ))
|
if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 ))
|
||||||
ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd,
|
ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd,
|
||||||
Tpm ? &Tpm->rcExclude : NULL);
|
Tpm ? &Tpm->rcExclude : NULL);
|
||||||
MenuExitTracking(Wnd);
|
MenuExitTracking(Wnd, TRUE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue