WinWorkstation.st
changeset 2755 ff1854ac742d
parent 2754 21cbbc8fbe09
child 2759 1b78ab98b22b
--- a/WinWorkstation.st	Fri Jun 04 11:07:40 1999 +0200
+++ b/WinWorkstation.st	Sat Jun 05 22:05:13 1999 +0200
@@ -40,6 +40,7 @@
 /* #define HANDLE_VIEWGRAVITY  /* not yet working */
 
 #define LATE_WM_PAINT                   /* fill-bg in ST/X thread (instead of in event-thread) */
+					/* seems to be needed to avoid DC conflicts */
 
 #define CACHE_LAST_DC                   /* remember last DC in gcData */
 #define CACHE_LAST_PEN                  /* remember last pen in gcData */
@@ -12525,7 +12526,14 @@
 
 	if (win) {
 	    CPRINTF(("activateWindow %x\n",win));
-	    // ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL);
+
+#if 0
+/* does not help the low-licenceBox bug ... */
+	    SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, 
+			 SWP_NOSENDCHANGING |
+			 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
+#endif
+
 	    ShowWindowAsync(win, SW_SHOWNORMAL);
 
 //            ShowWindow(win, SW_SHOW);
@@ -13339,6 +13347,41 @@
 %}
 !
 
+setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
+    "set the windows shape to an elliptical region"
+
+%{
+    if (__isExternalAddress(aWindowId)
+     && __bothSmallInteger(x, y)
+     && __bothSmallInteger(w, h)) {
+	HWND win = _HWNDVal(aWindowId);
+	int left = __intVal(x);
+	int top = __intVal(y);
+	int right = left + __intVal(w);
+	int bottom = top + __intVal(h);
+	HRGN rgn;
+	HDC winDC;
+
+	rgn = CreateEllipticRgn(left, top, right, bottom);
+	if (rgn) {
+	    winDC = GetDCEx(win, 0, DCX_WINDOW);
+	    if (winDC) {
+		if (SelectClipRgn(winDC, rgn) == ERROR ) {
+		    fprintf(stderr, "select clipping region failed\n");
+		}
+		ReleaseDC(win, winDC);
+	    }
+	    else
+		fprintf(stderr, "getDC failed\n");
+	}
+	else
+	    fprintf(stderr, "region creation failed\n");
+	RETURN ( self );
+    }
+%}.
+    self primitiveFailed
+!
+
 unmapWindow:aWindowId
     "make a window invisible"
 
@@ -13376,6 +13419,6 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.152 1999-06-04 09:07:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.153 1999-06-05 20:05:13 cg Exp $'
 ! !
 WinWorkstation initialize!