Mercurial > dwindows
comparison os2/dw.c @ 1445:8f7692fcad37
Use system metrics/values to get the scrollbar sizes on Windows and OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 08 Dec 2011 23:49:55 +0000 |
parents | 914ac25f7d37 |
children | 632346743f46 |
comparison
equal
deleted
inserted
replaced
1444:914ac25f7d37 | 1445:8f7692fcad37 |
---|---|
1051 { | 1051 { |
1052 int height = _get_height(parent); | 1052 int height = _get_height(parent); |
1053 | 1053 |
1054 return WinSetWindowPos(hwnd, behind, x, height - y - cy, cx, cy, fl); | 1054 return WinSetWindowPos(hwnd, behind, x, height - y - cy, cx, cy, fl); |
1055 } | 1055 } |
1056 | |
1057 #define _DW_DEFAULT_SCROLLBAR_WIDTH 14 | |
1058 | 1056 |
1059 /* This function calculates how much space the widgets and boxes require | 1057 /* This function calculates how much space the widgets and boxes require |
1060 * and does expansion as necessary. | 1058 * and does expansion as necessary. |
1061 */ | 1059 */ |
1062 static void _resize_box(Box *thisbox, int *depth, int x, int y, int pass) | 1060 static void _resize_box(Box *thisbox, int *depth, int x, int y, int pass) |
1281 unsigned int hpos = (unsigned int)WinSendMsg(hscroll, SBM_QUERYPOS, 0, 0); | 1279 unsigned int hpos = (unsigned int)WinSendMsg(hscroll, SBM_QUERYPOS, 0, 0); |
1282 unsigned int vpos = (unsigned int)WinSendMsg(vscroll, SBM_QUERYPOS, 0, 0); | 1280 unsigned int vpos = (unsigned int)WinSendMsg(vscroll, SBM_QUERYPOS, 0, 0); |
1283 | 1281 |
1284 /* Position the scrollbox parts */ | 1282 /* Position the scrollbox parts */ |
1285 _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad, width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER); | 1283 _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad, width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER); |
1286 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); | 1284 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); |
1287 WinSetWindowPos(hscroll, HWND_TOP, 0, 0, width - _DW_DEFAULT_SCROLLBAR_WIDTH, _DW_DEFAULT_SCROLLBAR_WIDTH, SWP_MOVE | SWP_SIZE | SWP_ZORDER); | 1285 WinSetWindowPos(hscroll, HWND_TOP, 0, 0, width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL), WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL), SWP_MOVE | SWP_SIZE | SWP_ZORDER); |
1288 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); | 1286 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); |
1289 | 1287 |
1290 origx = cx = width - _DW_DEFAULT_SCROLLBAR_WIDTH; | 1288 origx = cx = width - WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL); |
1291 origy = cy = height - _DW_DEFAULT_SCROLLBAR_WIDTH; | 1289 origy = cy = height - WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL); |
1292 | 1290 |
1293 /* Get the required space for the box */ | 1291 /* Get the required space for the box */ |
1294 _resize_box(contentbox, &depth, cx, cy, 1); | 1292 _resize_box(contentbox, &depth, cx, cy, 1); |
1295 | 1293 |
1296 if(cx < contentbox->minwidth) | 1294 if(cx < contentbox->minwidth) |
4600 { | 4598 { |
4601 /* Check for vertical scrollbar */ | 4599 /* Check for vertical scrollbar */ |
4602 if(strncmp(tmpbuf, "#8", 3)== 0 && | 4600 if(strncmp(tmpbuf, "#8", 3)== 0 && |
4603 WinQueryWindowULong(handle, QWL_STYLE) & SBS_VERT) | 4601 WinQueryWindowULong(handle, QWL_STYLE) & SBS_VERT) |
4604 { | 4602 { |
4605 thiswidth = _DW_DEFAULT_SCROLLBAR_WIDTH; | 4603 thiswidth = WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL); |
4606 thisheight = 100; | 4604 thisheight = 100; |
4607 } | 4605 } |
4608 else | 4606 else |
4609 { | 4607 { |
4610 thiswidth = 100; | 4608 thiswidth = 100; |
4611 thisheight = _DW_DEFAULT_SCROLLBAR_WIDTH; | 4609 thisheight = WinQuerySysValue(HWND_DESKTOP, SV_CYHSCROLL); |
4612 } | 4610 } |
4613 } | 4611 } |
4614 /* Spinbutton */ | 4612 /* Spinbutton */ |
4615 else if(strncmp(tmpbuf, "#32", 4)==0) | 4613 else if(strncmp(tmpbuf, "#32", 4)==0) |
4616 { | 4614 { |