Commit e3810e3a authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Check for SB_CTL before displaying a caret.

parent 50e8ea38
......@@ -816,7 +816,8 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
(SCROLL_TrackingBar == nBar))
SCROLL_DrawMovingThumb( hdc, &rect, vertical, arrowSize, thumbSize );
if(hwnd==GetFocus()) /* if scroll bar has focus, reposition the caret*/
/* if scroll bar has focus, reposition the caret*/
if(hwnd==GetFocus() && (nBar==SB_CTL))
{
if (!vertical)
{
......@@ -1174,22 +1175,19 @@ LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
/* Create a caret when a ScrollBar get focus*/
RECT rect;
int arrowSize, thumbSize, thumbPos, vertical;
if(hwnd==GetFocus())
vertical = SCROLL_GetScrollBarRect( hwnd, SB_CTL, &rect,
&arrowSize, &thumbSize, &thumbPos );
if (!vertical)
{
vertical = SCROLL_GetScrollBarRect( hwnd, SB_CTL, &rect,
&arrowSize, &thumbSize, &thumbPos );
if (!vertical)
{
CreateCaret(hwnd,1, thumbSize-2, rect.bottom-rect.top-2);
SetCaretPos(thumbPos+1, rect.top+1);
}
else
{
CreateCaret(hwnd,1, rect.right-rect.left-2,thumbSize-2);
SetCaretPos(rect.top+1, thumbPos+1);
}
ShowCaret(hwnd);
CreateCaret(hwnd,1, thumbSize-2, rect.bottom-rect.top-2);
SetCaretPos(thumbPos+1, rect.top+1);
}
else
{
CreateCaret(hwnd,1, rect.right-rect.left-2,thumbSize-2);
SetCaretPos(rect.top+1, thumbPos+1);
}
ShowCaret(hwnd);
}
break;
......
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