ModalBox.st
changeset 959 a47e44337899
parent 953 226d5ccde5fd
child 965 c95ecf109867
--- a/ModalBox.st	Thu Jul 18 17:17:42 1996 +0200
+++ b/ModalBox.st	Thu Jul 18 19:24:32 1996 +0200
@@ -87,8 +87,9 @@
 useTransientViews:aBoolean 
     "change the way modalBoxes are created on the Display.
      If the argument is true, transient views are used; otherwise
-     override redirect views are used. Depending on your windowmanager,
-     either one may have problems. You may want to change the setting
+     override redirect views are used. 
+     Depending on your windowmanager, either one may have problems. 
+     You may want to change the setting
      from your display.rc or d_xxx.rc file."
 
     UseTransientViews := aBoolean.
@@ -97,6 +98,8 @@
      ModalBox useTransientViews:false
      ModalBox useTransientViews:true 
     "
+
+    "Modified: 18.7.1996 / 19:18:46 / cg"
 ! !
 
 !ModalBox methodsFor:'accessing'!
@@ -577,7 +580,7 @@
      the current active windowgroups cursors to the busy-stop cursor, show
      a shadow, and raise the box."
 
-    |mainGroup mainView useTransient|
+    |mainGroup mainView mainViewID useTransient|
 
     useTransient := UseTransientViews.
 
@@ -586,50 +589,42 @@
     "
     mainGroup := WindowGroup activeGroup.
     mainGroup notNil ifTrue:[
-	mainGroup := mainGroup mainGroup.
-"/        mainGroup notNil ifTrue:[
-"/            mainGroup showCursor:(Cursor stop).
-"/        ]
+        mainGroup := mainGroup mainGroup.
     ].
 
-    mainGroup isNil ifTrue:[
-	useTransient := false
+"/    mainGroup isNil ifTrue:[
+"/        useTransient := false
+"/    ].
+
+    useTransient ifTrue:[
+        mainGroup notNil ifTrue:[
+            mainGroup topViews notNil ifTrue:[
+                mainView := mainGroup topViews first.
+            ].
+            mainView notNil ifTrue:[
+                mainViewID := mainView id.
+            ]
+        ]
     ].
 
     useTransient ifTrue:[
-	mainGroup topViews notNil ifTrue:[
-	    mainView := mainGroup topViews first.
-	].
-	mainView isNil ifTrue:[
-	    useTransient := false.
-	]
-    ].
-
-    useTransient ifTrue:[
-	shadowView := nil.
+        mainViewID isNil ifTrue:[
+            self origin:(device center - (self extent//2))
+        ].
+        shadowView := nil.
     ] ifFalse:[
-	shadowView notNil ifTrue:[shadowView realize].
+        shadowView notNil ifTrue:[shadowView realize].
     ].
     self raise.
 
     useTransient ifTrue:[
-	device setTransient:drawableId for:(mainView id).
+        device setTransient:drawableId for:mainViewID.
     ].
 
-"/    [
-	super openModal:aBlock inGroup:mainGroup.
-"/    ] valueNowOrOnUnwindDo:[
-"/        "
-"/         restore cursors in the main group
-"/        "
-"/        mainGroup notNil ifTrue:[
-"/            mainGroup restoreCursors.
-"/            mainGroup sensor flushUserEvents.
-"/        ]
-"/    ].
+    super openModal:aBlock inGroup:mainGroup.
 
     "Created: 10.12.1995 / 14:07:01 / cg"
-    "Modified: 10.12.1995 / 14:08:41 / cg"
+    "Modified: 18.7.1996 / 19:22:53 / cg"
 !
 
 positionOffset
@@ -825,6 +820,6 @@
 !ModalBox  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.46 1996-07-17 14:04:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.47 1996-07-18 17:24:32 cg Exp $'
 ! !
 ModalBox initialize!