Mercurial > dwindows
diff win/dw.c @ 182:b8caec82a4d2
Minor splitbar fixes on OS/2 and Windows. The splitbar width is now 4
making it divisible by 2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 06 Dec 2002 23:34:49 +0000 |
parents | 978b954eb70e |
children | f55677513954 |
line wrap: on
line diff
--- a/win/dw.c Mon Dec 02 19:40:40 2002 +0000 +++ b/win/dw.c Fri Dec 06 23:34:49 2002 +0000 @@ -1195,7 +1195,7 @@ int result = -1; static int command_active = 0; SignalHandler *tmp = Root; - void (* windowfunc)(PVOID); + void (*windowfunc)(PVOID); ULONG origmsg = msg; if(msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN) @@ -2320,26 +2320,26 @@ { if(type == BOXHORZ) { - int newx = x - SPLITBAR_WIDTH, newy = y; + int newx = x; float ratio = (float)percent/(float)100.0; HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); Box *tmp = (Box *)GetWindowLong(handle1, GWL_USERDATA); - newx = (int)((float)newx * ratio); + newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2); ShowWindow(handle1, SW_HIDE); ShowWindow(handle2, SW_HIDE); MoveWindow(handle1, 0, 0, newx, y, FALSE); - _do_resize(tmp, newx, y); + _do_resize(tmp, newx - 1, y - 1); tmp = (Box *)GetWindowLong(handle2, GWL_USERDATA); newx = x - newx - SPLITBAR_WIDTH; MoveWindow(handle2, x - newx, 0, newx, y, FALSE); - _do_resize(tmp, newx, y); + _do_resize(tmp, newx - 1, y - 1); ShowWindow(handle1, SW_SHOW); ShowWindow(handle2, SW_SHOW); @@ -2348,26 +2348,26 @@ } else { - int newx = x, newy = y - SPLITBAR_WIDTH; + int newy = y; float ratio = (float)(100.0-percent)/(float)100.0; HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); Box *tmp = (Box *)GetWindowLong(handle1, GWL_USERDATA); - newy = (int)((float)newy * ratio); + newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2); ShowWindow(handle1, SW_HIDE); ShowWindow(handle2, SW_HIDE); MoveWindow(handle1, 0, y - newy, x, newy, FALSE); - _do_resize(tmp, x, newy); + _do_resize(tmp, x - 1, newy - 1); tmp = (Box *)GetWindowLong(handle2, GWL_USERDATA); newy = y - newy - SPLITBAR_WIDTH; MoveWindow(handle2, 0, 0, x, newy, FALSE); - _do_resize(tmp, x, newy); + _do_resize(tmp, x - 1, newy - 1); ShowWindow(handle1, SW_SHOW); ShowWindow(handle2, SW_SHOW); @@ -2405,9 +2405,9 @@ dw_window_get_pos_size(hwnd, NULL, NULL, &cx, &cy); if(type == BOXHORZ) - Rectangle(hdcPaint, cx - start - 3, 0, cx - start, cy); + Rectangle(hdcPaint, cx - start - SPLITBAR_WIDTH, 0, cx - start, cy); else - Rectangle(hdcPaint, 0, start, cx, start + 3); + Rectangle(hdcPaint, 0, start, cx, start + SPLITBAR_WIDTH); SelectObject(hdcPaint, oldBrush); DeleteObject(SelectObject(hdcPaint, oldPen));