Check for SB_CTL before displaying a caret.

This commit is contained in:
Francois Gouget 2000-11-01 01:52:37 +00:00 committed by Alexandre Julliard
parent 50e8ea387b
commit e3810e3acc

View file

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