changeset 128:ac616f625443

Draw the splitbar solid pale gray. Maybe we should change this at some point.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 20 Oct 2002 06:28:28 +0000
parents c5c3ccb84ac7
children e47c52b37cdd
files os2/dw.c
diffstat 1 files changed, 39 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Sun Oct 20 06:10:31 2002 +0000
+++ b/os2/dw.c	Sun Oct 20 06:28:28 2002 +0000
@@ -64,13 +64,6 @@
 }
 #endif
 
-static LONG lColor[SPLITBAR_WIDTH] =
-{
-    DW_CLR_BLACK,
-    DW_CLR_PALEGRAY,
-    DW_CLR_WHITE
-};
-
 typedef struct _sighandler
 {
 	struct _sighandler	*next;
@@ -2362,45 +2355,21 @@
 		break;
 	case WM_PAINT:
 		{
-			HPS hpsPaint;
-			RECTL rclPaint;
-			POINTL ptlStart[SPLITBAR_WIDTH];
-			POINTL ptlEnd[SPLITBAR_WIDTH];
-			USHORT i;
-
-			hpsPaint = WinBeginPaint(hwnd, 0, 0);
-			WinQueryWindowRect(hwnd, &rclPaint);
-
-			if(type == BOXHORZ)
-			{
-				for(i = 0; i < SPLITBAR_WIDTH; i++)
-				{
-					ptlStart[i].x = rclPaint.xLeft + i + start;
-					ptlStart[i].y = rclPaint.yTop;
-
-					ptlEnd[i].x = rclPaint.xLeft + i + start;
-					ptlEnd[i].y = rclPaint.yBottom;
-				}
-			}
-			else
-			{
-				for(i = 0; i < SPLITBAR_WIDTH; i++)
-				{
-					ptlStart[i].x = rclPaint.xLeft;
-					ptlStart[i].y = rclPaint.yBottom + i + start;
-
-					ptlEnd[i].x = rclPaint.xRight;
-					ptlEnd[i].y = rclPaint.yBottom + i + start;
-				}
-			}
-
-			for(i = 0; i < SPLITBAR_WIDTH; i++)
-			{
-				GpiSetColor( hpsPaint, lColor[i]);
-				GpiMove(hpsPaint, &ptlStart[i]);
-				GpiLine(hpsPaint, &ptlEnd[i]);
-			}
-			WinEndPaint(hpsPaint);
+			HPS hps;
+			RECTL rcl;
+			POINTL ptl[2];
+
+			hps = WinBeginPaint(hwnd, 0, 0);
+			WinQueryWindowRect(hwnd, &rcl);
+			ptl[0].x = rcl.xLeft;
+			ptl[0].y = rcl.yBottom;
+			ptl[1].x = rcl.xRight;
+			ptl[1].y = rcl.yTop;
+
+			GpiSetColor(hps, CLR_PALEGRAY);
+			GpiMove(hps, &ptl[0]);
+			GpiBox(hps, DRO_OUTLINEFILL, &ptl[1], 0, 0);
+			WinEndPaint(hps);
 		}
 		return MRFROMSHORT(FALSE);
 
@@ -2760,6 +2729,30 @@
 
 	switch(msg)
 	{
+#if 0 /* Why doesn't this work? */
+	case WM_PAINT:
+		{
+			HPS hps;
+			RECTL rcl;
+			POINTL ptl[2];
+
+			if(oldproc)
+				return oldproc(hwnd, msg, mp1, mp2);
+
+			hps = WinBeginPaint(hwnd, 0, 0);
+			WinQueryWindowRect(hwnd, &rcl);
+			ptl[0].x = rcl.xLeft + 1;
+			ptl[0].y = rcl.yBottom + 1;
+			ptl[1].x = rcl.xRight - 1;
+			ptl[1].y = rcl.yTop - 1;
+
+			GpiSetColor(hps, CLR_BLACK);
+			GpiMove(hps, &ptl[0]);
+			GpiBox(hps, DRO_OUTLINE, &ptl[1], 0, 0);
+			WinEndPaint(hps);
+		}
+		return MRFROMSHORT(FALSE);
+#endif
 	case WM_SETFOCUS:
 		_run_event(hwnd, msg, mp1, mp2);
 		break;