ModalBox.st
changeset 675 fc15e8886089
parent 644 85ce9499c925
child 752 d9ee7d398ad6
--- a/ModalBox.st	Sun May 12 21:38:22 1996 +0200
+++ b/ModalBox.st	Sun May 12 21:58:58 1996 +0200
@@ -106,10 +106,13 @@
      If set, the box will take total control over the
      keyboard, not allowing input to other views/boxes
      while active.
-     Danger: only use this for very very urgent boxes, since
-     no interaction with any view on the screen is possible then."
+     DANGER: 
+        only use this for very very urgent boxes, since
+        no interaction with ANY view on the screen is possible then."
 
     exclusiveKeyboard := aBoolean
+
+    "Modified: 12.5.1996 / 21:55:09 / cg"
 ! !
 
 !ModalBox methodsFor:'event handling'!
@@ -205,17 +208,29 @@
 !
 
 destroy
+    "destroy the view.
+     redefined to also destroy my shadow, if there is one,
+     and to release the global keyboard grab (if there is one)"
+
     shadowView notNil ifTrue:[
-	shadowView destroy.
-	shadowView := nil
+        shadowView destroy.
+        shadowView := nil
     ].
-    self leaveControl. "just to make sure"
+    exclusiveKeyboard ifTrue:[
+        device ungrabKeyboard
+    ].
     super destroy.
+
+    "Modified: 12.5.1996 / 21:56:10 / cg"
 !
 
 initEvents
+    "initialize event handling; redefined to enable visibility changes"
+
     super initEvents.
     self enableEvent:#visibilityChange
+
+    "Modified: 12.5.1996 / 21:56:31 / cg"
 !
 
 initStyle
@@ -298,7 +313,12 @@
 !
 
 isPopUpView
+    "return true, if I want to come up without decoration
+     and popUp to top immediately."
+
     ^ UseTransientViews not
+
+    "Modified: 12.5.1996 / 21:57:58 / cg"
 !
 
 reinitialize
@@ -403,14 +423,6 @@
     "Modified: 3.5.1996 / 23:47:47 / stefan"
 ! !
 
-!ModalBox methodsFor:'private'!
-
-leaveControl
-    exclusiveKeyboard ifTrue:[
-	device ungrabKeyboard
-    ]
-! !
-
 !ModalBox methodsFor:'queries'!
 
 preferredExtent
@@ -474,7 +486,10 @@
 
     shadowView notNil ifTrue:[shadowView unmap].
     windowGroup notNil ifTrue:[windowGroup focusView:nil].
-    self leaveControl.
+    exclusiveKeyboard ifTrue:[
+        device ungrabKeyboard
+    ].
+
     self unmap.
     device flush. 
 
@@ -492,6 +507,7 @@
     ].
 
     "Modified: 3.5.1996 / 23:47:57 / stefan"
+    "Modified: 12.5.1996 / 21:54:22 / cg"
 !
 
 hideRequest
@@ -787,6 +803,6 @@
 !ModalBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.41 1996-05-03 23:09:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.42 1996-05-12 19:58:58 cg Exp $'
 ! !
 ModalBox initialize!