Commit 79910bcf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Pass scroll enable flags to ScrollBarDraw.

parent 41989351
......@@ -125,7 +125,7 @@ SCROLLBAR_INFO *SCROLL_GetInternalInfo( HWND hwnd, INT nBar, BOOL alloc )
*
* Draw the scroll bar arrows.
*/
static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
static void SCROLL_DrawArrows( HDC hdc, UINT flags,
RECT *rect, INT arrowSize, BOOL vertical,
BOOL top_pressed, BOOL bottom_pressed )
{
......@@ -140,7 +140,7 @@ static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
DrawFrameControl( hdc, &r, DFC_SCROLL,
(vertical ? DFCS_SCROLLUP : DFCS_SCROLLLEFT)
| (top_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
| (infoPtr->flags&ESB_DISABLE_LTUP ? DFCS_INACTIVE : 0 ) );
| (flags & ESB_DISABLE_LTUP ? DFCS_INACTIVE : 0 ) );
r = *rect;
if( vertical )
......@@ -151,7 +151,7 @@ static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
DrawFrameControl( hdc, &r, DFC_SCROLL,
(vertical ? DFCS_SCROLLDOWN : DFCS_SCROLLRIGHT)
| (bottom_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
| (infoPtr->flags&ESB_DISABLE_RTDN ? DFCS_INACTIVE : 0) );
| (flags & ESB_DISABLE_RTDN ? DFCS_INACTIVE : 0) );
}
/***********************************************************************
......@@ -161,8 +161,7 @@ static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
*/
static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
RECT *rect, INT arrowSize,
INT thumbSize, INT thumbPos,
UINT flags, BOOL vertical,
INT thumbSize, INT thumbPos, BOOL vertical,
BOOL top_selected, BOOL bottom_selected )
{
RECT r;
......@@ -247,11 +246,9 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
void WINAPI USER_ScrollBarDraw( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HITTEST hit_test,
const struct SCROLL_TRACKING_INFO *tracking_info, BOOL arrows,
BOOL interior, RECT *rect, INT arrowSize, INT thumbPos,
INT thumbSize, BOOL vertical )
BOOL interior, RECT *rect, UINT enable_flags, INT arrowSize,
INT thumbPos, INT thumbSize, BOOL vertical )
{
SCROLLBAR_INFO *infoPtr;
if (nBar == SB_CTL)
{
DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
......@@ -274,34 +271,29 @@ void WINAPI USER_ScrollBarDraw( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HITTES
}
}
if (!(infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE )))
return;
/* Draw the arrows */
/* Draw the arrows */
if (arrows && arrowSize)
{
if (vertical == tracking_info->vertical && GetCapture() == hwnd)
SCROLL_DrawArrows( hdc, infoPtr, rect, arrowSize, vertical,
SCROLL_DrawArrows( hdc, enable_flags, rect, arrowSize, vertical,
hit_test == tracking_info->hit_test && hit_test == SCROLL_TOP_ARROW,
hit_test == tracking_info->hit_test && hit_test == SCROLL_BOTTOM_ARROW );
else
SCROLL_DrawArrows( hdc, infoPtr, rect, arrowSize, vertical, FALSE, FALSE );
SCROLL_DrawArrows( hdc, enable_flags, rect, arrowSize, vertical, FALSE, FALSE );
}
if (interior)
{
if (vertical == tracking_info->vertical && GetCapture() == hwnd)
{
SCROLL_DrawInterior( hwnd, hdc, nBar, rect, arrowSize, thumbSize, thumbPos,
infoPtr->flags, vertical,
SCROLL_DrawInterior( hwnd, hdc, nBar, rect, arrowSize, thumbSize, thumbPos, vertical,
hit_test == tracking_info->hit_test && hit_test == SCROLL_TOP_RECT,
hit_test == tracking_info->hit_test && hit_test == SCROLL_BOTTOM_RECT );
}
else
{
SCROLL_DrawInterior( hwnd, hdc, nBar, rect, arrowSize, thumbSize, thumbPos,
infoPtr->flags, vertical, FALSE, FALSE );
vertical, FALSE, FALSE );
}
}
......
......@@ -178,7 +178,7 @@ static NTSTATUS WINAPI User32DrawScrollBar( const struct draw_scroll_bar_params
RECT rect = params->rect;
user_api->pScrollBarDraw( params->hwnd, params->hdc, params->bar, params->hit_test,
&params->tracking_info, params->arrows, params->interior,
&rect, params->arrow_size, params->thumb_pos,
&rect, params->enable_flags, params->arrow_size, params->thumb_pos,
params->thumb_size, params->vertical );
return 0;
}
......
......@@ -177,8 +177,8 @@ extern struct user_api_hook *user_api DECLSPEC_HIDDEN;
LRESULT WINAPI USER_DefDlgProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
LRESULT WINAPI USER_ScrollBarProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
void WINAPI USER_ScrollBarDraw(HWND, HDC, INT, enum SCROLL_HITTEST,
const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, INT, INT,
INT, BOOL) DECLSPEC_HIDDEN;
const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, UINT,
INT, INT, INT, BOOL) DECLSPEC_HIDDEN;
struct scroll_info *SCROLL_GetInternalInfo( HWND hwnd, INT nBar, BOOL alloc );
#endif /* __WINE_USER_PRIVATE_H */
......@@ -34,8 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(theme_scroll);
void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTEST hit_test,
const struct SCROLL_TRACKING_INFO *tracking_info,
BOOL draw_arrows, BOOL draw_interior, RECT *rect, INT arrowsize,
INT thumbpos, INT thumbsize, BOOL vertical)
BOOL draw_arrows, BOOL draw_interior, RECT *rect, UINT enable_flags,
INT arrowsize, INT thumbpos, INT thumbsize, BOOL vertical)
{
BOOL disabled = !IsWindowEnabled(hwnd);
HTHEME theme;
......@@ -49,7 +49,7 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
if (!theme)
{
user_api.pScrollBarDraw(hwnd, dc, bar, hit_test, tracking_info, draw_arrows, draw_interior,
rect, arrowsize, thumbpos, thumbsize, vertical);
rect, enable_flags, arrowsize, thumbpos, thumbsize, vertical);
return;
}
......
......@@ -109,8 +109,8 @@ extern struct user_api_hook user_api DECLSPEC_HIDDEN;
LRESULT WINAPI UXTHEME_DefDlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL unicode) DECLSPEC_HIDDEN;
void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTEST hit_test,
const struct SCROLL_TRACKING_INFO *tracking_info,
BOOL draw_arrows, BOOL draw_interior, RECT *rect, INT arrowsize,
INT thumbpos, INT thumbsize, BOOL vertical) DECLSPEC_HIDDEN;
BOOL draw_arrows, BOOL draw_interior, RECT *rect, UINT enable_flags,
INT arrowsize, INT thumbpos, INT thumbsize, BOOL vertical) DECLSPEC_HIDDEN;
LRESULT WINAPI UXTHEME_ScrollbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
BOOL unicode) DECLSPEC_HIDDEN;
......
......@@ -4789,8 +4789,8 @@ struct user_api_hook
{
LRESULT (WINAPI *pDefDlgProc)(HWND, UINT, WPARAM, LPARAM, BOOL);
void (WINAPI *pScrollBarDraw)(HWND, HDC, INT, enum SCROLL_HITTEST,
const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, INT, INT,
INT, BOOL);
const struct SCROLL_TRACKING_INFO *, BOOL, BOOL, RECT *, UINT,
INT, INT, INT, BOOL);
LRESULT (WINAPI *pScrollBarWndProc)(HWND, UINT, WPARAM, LPARAM, BOOL);
};
......
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