From 98bcdf9e5dd2ab8194871116c62b81591631c4b5 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 24 Mar 2003 19:36:17 +0000 Subject: [PATCH] Revert broken change to the scrollbar position adjustment code. --- controls/scroll.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/controls/scroll.c b/controls/scroll.c index b86ea5fa23f..ce13566ad20 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -1221,7 +1221,6 @@ static void SCROLL_CreateScrollBar( HWND hwnd /* [in] Handle of window with scrollbar(s) */, LPCREATESTRUCTW lpCreate /* [in] The style and place of the scroll bar */) { - POINT pos, size; LPSCROLLBAR_INFO info = SCROLL_GetScrollBarInfo(hwnd, SB_CTL); if (!info) return; @@ -1233,23 +1232,28 @@ LPCREATESTRUCTW lpCreate /* [in] The style and place of the scroll bar */) TRACE("Created WS_DISABLED scrollbar\n"); } - /* copy the desired positions and size */ - pos.x = lpCreate->x; pos.y = lpCreate->y; - size.x = lpCreate->cx; size.y = lpCreate->cy; - - /* move position based on style */ - if (lpCreate->style & SBS_RIGHTALIGN) - pos.x += size.x - GetSystemMetrics(SM_CXVSCROLL) - 1; - else if (lpCreate->style & SBS_BOTTOMALIGN) - pos.y += size.y - GetSystemMetrics(SM_CYHSCROLL) - 1; - - /* change size based on style */ if (lpCreate->style & SBS_VERT) - size.x = GetSystemMetrics(SM_CXVSCROLL) + 1; - else - size.y = GetSystemMetrics(SM_CYHSCROLL) + 1; - - MoveWindow(hwnd, pos.x, pos.y, size.x, size.y, FALSE); + { + if (lpCreate->style & SBS_LEFTALIGN) + MoveWindow( hwnd, lpCreate->x, lpCreate->y, + GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE ); + else if (lpCreate->style & SBS_RIGHTALIGN) + MoveWindow( hwnd, + lpCreate->x+lpCreate->cx-GetSystemMetrics(SM_CXVSCROLL)-1, + lpCreate->y, + GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE ); + } + else /* SBS_HORZ */ + { + if (lpCreate->style & SBS_TOPALIGN) + MoveWindow( hwnd, lpCreate->x, lpCreate->y, + lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); + else if (lpCreate->style & SBS_BOTTOMALIGN) + MoveWindow( hwnd, + lpCreate->x, + lpCreate->y+lpCreate->cy-GetSystemMetrics(SM_CYHSCROLL)-1, + lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); + } }