From 64d95e9374f2b44a44c34d6597763741438caf3b Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 15 Oct 2000 00:28:44 +0000 Subject: [PATCH] Draw the scrollbar beside the buddy when neither UDS_ALIGN[RIGHT|LEFT] is given. --- dlls/comctl32/updown.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 24c716a7acc..0d6ab31d9da 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -478,23 +478,22 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud) // its already been subclassed, don't overwrite BUDDY_SUPERCLASS_WNDPROC } - /* do we need to do any adjustments? */ - if(!(dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT))) - return TRUE; - /* Get the rect of the buddy relative to its parent */ GetWindowRect(infoPtr->Buddy, &budRect); MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Buddy), (POINT *)(&budRect.left), 2); /* now do the positioning */ - if(dwStyle & UDS_ALIGNRIGHT){ + if (dwStyle & UDS_ALIGNLEFT) { + x = budRect.left; + budRect.left += DEFAULT_WIDTH+DEFAULT_XSEP; + } + else if (dwStyle & UDS_ALIGNRIGHT){ budRect.right -= DEFAULT_WIDTH+DEFAULT_XSEP; x = budRect.right+DEFAULT_XSEP; } - else{ /* UDS_ALIGNLEFT */ - x = budRect.left; - budRect.left += DEFAULT_WIDTH+DEFAULT_XSEP; + else { + x = budRect.right+DEFAULT_XSEP; } /* first adjust the buddy to accomodate the up/down */ @@ -514,10 +513,10 @@ static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud) */ if (UPDOWN_HasBuddyBorder(hwnd)) { - if(dwStyle & UDS_ALIGNRIGHT) - x-=DEFAULT_BUDDYBORDER; - else + if(dwStyle & UDS_ALIGNLEFT) width+=DEFAULT_BUDDYBORDER; + else + x-=DEFAULT_BUDDYBORDER; } SetWindowPos (hwnd, infoPtr->Buddy, @@ -822,6 +821,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, case VK_UP: case VK_DOWN: UPDOWN_GetBuddyInt (hwnd); + /* Fixme: Paint the according button pressed for some time, like win95 does*/ UPDOWN_DoAction (hwnd, 1, wParam==VK_UP); break; }