changeset 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 b5a92b04b298
files dw.h os2/dw.c win/dw.c
diffstat 3 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Mon Dec 02 19:40:40 2002 +0000
+++ b/dw.h	Fri Dec 06 23:34:49 2002 +0000
@@ -22,7 +22,7 @@
 #define SIZESTATIC 0
 #define SIZEEXPAND 1
 
-#define SPLITBAR_WIDTH 3
+#define SPLITBAR_WIDTH 4
 #define BUBBLE_HELP_MAX 256
 
 typedef struct _user_data
--- a/os2/dw.c	Mon Dec 02 19:40:40 2002 +0000
+++ b/os2/dw.c	Fri Dec 06 23:34:49 2002 +0000
@@ -2258,7 +2258,7 @@
 {
 	int result = -1;
 	static int command_active = 0;
-	void (* windowfunc)(PVOID) = 0L;
+	void (* API windowfunc)(PVOID) = 0L;
 
 	if(!command_active)
 	{
@@ -2389,7 +2389,7 @@
 		}
 		break;
 	case WM_USER:
-		windowfunc = (void (*)(void *))mp1;
+		windowfunc = (void (* API)(void *))mp1;
 
 		if(windowfunc)
 			windowfunc((void *)mp2);
@@ -2447,7 +2447,7 @@
 {
 	if(type == BOXHORZ)
 	{
-		int newx = x - SPLITBAR_WIDTH;
+		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");
@@ -2456,10 +2456,10 @@
 		WinShowWindow(handle1, FALSE);
 		WinShowWindow(handle2, FALSE);
 
-		newx = (int)((float)newx * ratio);
+		newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2);
 
 		WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, newx, y);
+		_do_resize(tmp, newx - 1, y - 1);
 
 		dw_window_set_data(hwnd, "_dw_start", (void *)newx);
 
@@ -2468,14 +2468,14 @@
 		newx = x - newx - SPLITBAR_WIDTH;
 
 		WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, newx, y);
+		_do_resize(tmp, newx - 1, y - 1);
 
 		WinShowWindow(handle1, TRUE);
 		WinShowWindow(handle2, TRUE);
 	}
 	else
 	{
-		int newy = y - SPLITBAR_WIDTH;
+		int newy = y;
 		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");
@@ -2484,17 +2484,17 @@
 		WinShowWindow(handle1, FALSE);
 		WinShowWindow(handle2, FALSE);
 
-		newy = (int)((float)newy * ratio);
+		newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2);
 
 		WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, x, newy);
+		_do_resize(tmp, x - 1, newy - 1);
 
 		tmp = WinQueryWindowPtr(handle2, QWP_USER);
 
 		newy = y - newy - SPLITBAR_WIDTH;
 
 		WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, x, newy);
+		_do_resize(tmp, x - 1, newy - 1);
 
 		WinShowWindow(handle1, TRUE);
 		WinShowWindow(handle2, TRUE);
--- 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));