# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1323388195 0 # Node ID 8f7692fcad37fc6f3a852099260326d4cf7ff9d7 # Parent 914ac25f7d3789867b7e87e9f92541004b99edeb Use system metrics/values to get the scrollbar sizes on Windows and OS/2. diff -r 914ac25f7d37 -r 8f7692fcad37 os2/dw.c --- a/os2/dw.c Thu Dec 08 23:32:40 2011 +0000 +++ b/os2/dw.c Thu Dec 08 23:49:55 2011 +0000 @@ -1054,8 +1054,6 @@ return WinSetWindowPos(hwnd, behind, x, height - y - cy, cx, cy, fl); } -#define _DW_DEFAULT_SCROLLBAR_WIDTH 14 - /* This function calculates how much space the widgets and boxes require * and does expansion as necessary. */ @@ -1283,12 +1281,12 @@ /* Position the scrollbox parts */ _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad, width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER); - WinSetWindowPos(client, HWND_TOP, 0, _DW_DEFAULT_SCROLLBAR_WIDTH, width - _DW_DEFAULT_SCROLLBAR_WIDTH, height - _DW_DEFAULT_SCROLLBAR_WIDTH, SWP_MOVE | SWP_SIZE | SWP_ZORDER); - WinSetWindowPos(hscroll, HWND_TOP, 0, 0, width - _DW_DEFAULT_SCROLLBAR_WIDTH, _DW_DEFAULT_SCROLLBAR_WIDTH, SWP_MOVE | SWP_SIZE | SWP_ZORDER); - WinSetWindowPos(vscroll, HWND_TOP, width - _DW_DEFAULT_SCROLLBAR_WIDTH, _DW_DEFAULT_SCROLLBAR_WIDTH, _DW_DEFAULT_SCROLLBAR_WIDTH, height - _DW_DEFAULT_SCROLLBAR_WIDTH, SWP_MOVE | SWP_SIZE | SWP_ZORDER); - - origx = cx = width - _DW_DEFAULT_SCROLLBAR_WIDTH; - origy = cy = height - _DW_DEFAULT_SCROLLBAR_WIDTH; + WinSetWindowPos(client, HWND_TOP, 0, WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL), height - WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), SWP_MOVE | SWP_SIZE | SWP_ZORDER); + WinSetWindowPos(hscroll, HWND_TOP, 0, 0, width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL), WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), SWP_MOVE | SWP_SIZE | SWP_ZORDER); + WinSetWindowPos(vscroll, HWND_TOP, width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL), WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL), height - WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), SWP_MOVE | SWP_SIZE | SWP_ZORDER); + + origx = cx = width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL); + origy = cy = height - WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL); /* Get the required space for the box */ _resize_box(contentbox, &depth, cx, cy, 1); @@ -4602,13 +4600,13 @@ if(strncmp(tmpbuf, "#8", 3)== 0 && WinQueryWindowULong(handle, QWL_STYLE) & SBS_VERT) { - thiswidth = _DW_DEFAULT_SCROLLBAR_WIDTH; + thiswidth = WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL); thisheight = 100; } else { thiswidth = 100; - thisheight = _DW_DEFAULT_SCROLLBAR_WIDTH; + thisheight = WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL); } } /* Spinbutton */ diff -r 914ac25f7d37 -r 8f7692fcad37 win/dw.c --- a/win/dw.c Thu Dec 08 23:32:40 2011 +0000 +++ b/win/dw.c Thu Dec 08 23:49:55 2011 +0000 @@ -4247,14 +4247,14 @@ GetWindowLong(handle, GWL_STYLE) & SBS_VERT) { /* Vertical */ - thiswidth = 14; + thiswidth = GetSystemMetrics(SM_CXVSCROLL); thisheight = 100; } else { /* Horizontal */ thiswidth = 100; - thisheight = 14; + thisheight = GetSystemMetrics(SM_CYHSCROLL); } } /* Spinbuttons */