comparison os2/dw.c @ 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
comparison
equal deleted inserted replaced
127:c5c3ccb84ac7 128:ac616f625443
61 { 61 {
62 fclose(f); 62 fclose(f);
63 f = fopen("dw.log", "a+"); 63 f = fopen("dw.log", "a+");
64 } 64 }
65 #endif 65 #endif
66
67 static LONG lColor[SPLITBAR_WIDTH] =
68 {
69 DW_CLR_BLACK,
70 DW_CLR_PALEGRAY,
71 DW_CLR_WHITE
72 };
73 66
74 typedef struct _sighandler 67 typedef struct _sighandler
75 { 68 {
76 struct _sighandler *next; 69 struct _sighandler *next;
77 ULONG message; 70 ULONG message;
2360 _handle_splitbar_resize(hwnd, *percent, type, x, y); 2353 _handle_splitbar_resize(hwnd, *percent, type, x, y);
2361 } 2354 }
2362 break; 2355 break;
2363 case WM_PAINT: 2356 case WM_PAINT:
2364 { 2357 {
2365 HPS hpsPaint; 2358 HPS hps;
2366 RECTL rclPaint; 2359 RECTL rcl;
2367 POINTL ptlStart[SPLITBAR_WIDTH]; 2360 POINTL ptl[2];
2368 POINTL ptlEnd[SPLITBAR_WIDTH]; 2361
2369 USHORT i; 2362 hps = WinBeginPaint(hwnd, 0, 0);
2370 2363 WinQueryWindowRect(hwnd, &rcl);
2371 hpsPaint = WinBeginPaint(hwnd, 0, 0); 2364 ptl[0].x = rcl.xLeft;
2372 WinQueryWindowRect(hwnd, &rclPaint); 2365 ptl[0].y = rcl.yBottom;
2373 2366 ptl[1].x = rcl.xRight;
2374 if(type == BOXHORZ) 2367 ptl[1].y = rcl.yTop;
2375 { 2368
2376 for(i = 0; i < SPLITBAR_WIDTH; i++) 2369 GpiSetColor(hps, CLR_PALEGRAY);
2377 { 2370 GpiMove(hps, &ptl[0]);
2378 ptlStart[i].x = rclPaint.xLeft + i + start; 2371 GpiBox(hps, DRO_OUTLINEFILL, &ptl[1], 0, 0);
2379 ptlStart[i].y = rclPaint.yTop; 2372 WinEndPaint(hps);
2380
2381 ptlEnd[i].x = rclPaint.xLeft + i + start;
2382 ptlEnd[i].y = rclPaint.yBottom;
2383 }
2384 }
2385 else
2386 {
2387 for(i = 0; i < SPLITBAR_WIDTH; i++)
2388 {
2389 ptlStart[i].x = rclPaint.xLeft;
2390 ptlStart[i].y = rclPaint.yBottom + i + start;
2391
2392 ptlEnd[i].x = rclPaint.xRight;
2393 ptlEnd[i].y = rclPaint.yBottom + i + start;
2394 }
2395 }
2396
2397 for(i = 0; i < SPLITBAR_WIDTH; i++)
2398 {
2399 GpiSetColor( hpsPaint, lColor[i]);
2400 GpiMove(hpsPaint, &ptlStart[i]);
2401 GpiLine(hpsPaint, &ptlEnd[i]);
2402 }
2403 WinEndPaint(hpsPaint);
2404 } 2373 }
2405 return MRFROMSHORT(FALSE); 2374 return MRFROMSHORT(FALSE);
2406 2375
2407 case WM_MOUSEMOVE: 2376 case WM_MOUSEMOVE:
2408 { 2377 {
2758 if(blah) 2727 if(blah)
2759 oldproc = blah->oldproc; 2728 oldproc = blah->oldproc;
2760 2729
2761 switch(msg) 2730 switch(msg)
2762 { 2731 {
2732 #if 0 /* Why doesn't this work? */
2733 case WM_PAINT:
2734 {
2735 HPS hps;
2736 RECTL rcl;
2737 POINTL ptl[2];
2738
2739 if(oldproc)
2740 return oldproc(hwnd, msg, mp1, mp2);
2741
2742 hps = WinBeginPaint(hwnd, 0, 0);
2743 WinQueryWindowRect(hwnd, &rcl);
2744 ptl[0].x = rcl.xLeft + 1;
2745 ptl[0].y = rcl.yBottom + 1;
2746 ptl[1].x = rcl.xRight - 1;
2747 ptl[1].y = rcl.yTop - 1;
2748
2749 GpiSetColor(hps, CLR_BLACK);
2750 GpiMove(hps, &ptl[0]);
2751 GpiBox(hps, DRO_OUTLINE, &ptl[1], 0, 0);
2752 WinEndPaint(hps);
2753 }
2754 return MRFROMSHORT(FALSE);
2755 #endif
2763 case WM_SETFOCUS: 2756 case WM_SETFOCUS:
2764 _run_event(hwnd, msg, mp1, mp2); 2757 _run_event(hwnd, msg, mp1, mp2);
2765 break; 2758 break;
2766 case WM_CHAR: 2759 case WM_CHAR:
2767 if(SHORT1FROMMP(mp2) == '\t') 2760 if(SHORT1FROMMP(mp2) == '\t')