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