--- a/SimpleView.st Tue Jan 19 16:23:55 1999 +0100
+++ b/SimpleView.st Wed Jan 20 20:28:37 1999 +0100
@@ -7603,99 +7603,101 @@
|tops mainView mainViewID|
self isPopUpView ifFalse:[
- ModalBox usingTransientViews ifTrue:[
- mainGroup notNil ifTrue:[
- mainGroup topViews notNil ifTrue:[
- mainView := mainGroup topViews first.
- ].
- mainView notNil ifTrue:[
- mainViewID := mainView id.
- ]
- ].
-
- mainViewID isNil ifTrue:[
- self origin:(device center - (self extent//2))
- ].
-
- drawableId isNil ifTrue:[self create].
- device setTransient:drawableId for:mainViewID.
- ].
+ ModalBox usingTransientViews ifTrue:[
+ mainGroup notNil ifTrue:[
+ (tops := mainGroup topViews) notNil ifTrue:[
+ tops notEmpty ifTrue:[
+ mainView := tops first.
+ mainView notNil ifTrue:[
+ mainViewID := mainView id.
+ ]
+ ]
+ ].
+ ].
+
+ mainViewID isNil ifTrue:[
+ self origin:(device center - (self extent//2))
+ ].
+
+ drawableId isNil ifTrue:[self create].
+ device setTransient:drawableId for:mainViewID.
+ ].
].
self raise.
Processor activeProcessIsSystemProcess ifTrue:[
- "
- put myself into the modal group, let it handle events for
- me as well. This is only a half way solution, since the view
- is not modal at all ... however, the only situation
- where this happens is with modal boxes popped while in a
- modal browser. You will forgive me for that inconvenience.
- "
- windowGroup := mainGroup.
- mainGroup notNil ifTrue:[mainGroup addTopView:self].
- self realize
+ "
+ put myself into the modal group, let it handle events for
+ me as well. This is only a half way solution, since the view
+ is not modal at all ... however, the only situation
+ where this happens is with modal boxes popped while in a
+ modal browser. You will forgive me for that inconvenience.
+ "
+ windowGroup := mainGroup.
+ mainGroup notNil ifTrue:[mainGroup addTopView:self].
+ self realize
] ifFalse:[
- "
- show a stop-cursor in the main group
- "
- mainGroup notNil ifTrue:[
- self isPopUpView ifFalse:[
- mainGroup showCursor:(Cursor stop).
- ]
- ].
-
- "
- create a new window group and put myself into it
- "
- windowGroup := WindowGroup new.
- windowGroup addTopView:self.
-
- superView notNil ifTrue:[
- "/
- "/ special: this is a modal subview,
- "/ prevent the view from reassigning its windowGroup when realized
- "/ (subviews normally place themself into the superviews group)
- "/
- windowGroup isForModalSubview:true.
- ].
-
- "
- go dispatch events in this new group
- (thus current windowgroup is blocked from interaction)
- "
- AbortSignal handle:[:ex |
- self hide.
- ex return.
- ] do:[
- [
- [
- windowGroup startupModal:[realized and:aBlock] forGroup:mainGroup
- ] valueOnUnwindDo:[
- self hide
- ]
- ] valueNowOrOnUnwindDo:[
- mainGroup notNil ifTrue:[
- ReturnFocusWhenClosingModalBoxes ifTrue:[
- "
- return input focus to previously active groups top.
- This helps with windowmanagers which need an explicit click
- on the view for the focus.
- "
- tops := mainGroup topViews.
- (tops notNil and:[tops notEmpty]) ifTrue:[
- tops first getKeyboardFocus
- ]
- ].
-
- "
- restore cursors in the main group & flush its buffered key & mouse events
- "
- mainGroup restoreCursors.
+ "
+ show a stop-cursor in the main group
+ "
+ mainGroup notNil ifTrue:[
+ self isPopUpView ifFalse:[
+ mainGroup showCursor:(Cursor stop).
+ ]
+ ].
+
+ "
+ create a new window group and put myself into it
+ "
+ windowGroup := WindowGroup new.
+ windowGroup addTopView:self.
+
+ superView notNil ifTrue:[
+ "/
+ "/ special: this is a modal subview,
+ "/ prevent the view from reassigning its windowGroup when realized
+ "/ (subviews normally place themself into the superviews group)
+ "/
+ windowGroup isForModalSubview:true.
+ ].
+
+ "
+ go dispatch events in this new group
+ (thus current windowgroup is blocked from interaction)
+ "
+ AbortSignal handle:[:ex |
+ self hide.
+ ex return.
+ ] do:[
+ [
+ [
+ windowGroup startupModal:[realized and:aBlock] forGroup:mainGroup
+ ] valueOnUnwindDo:[
+ self hide
+ ]
+ ] valueNowOrOnUnwindDo:[
+ mainGroup notNil ifTrue:[
+ ReturnFocusWhenClosingModalBoxes ifTrue:[
+ "
+ return input focus to previously active groups top.
+ This helps with windowmanagers which need an explicit click
+ on the view for the focus.
+ "
+ tops := mainGroup topViews.
+ (tops notNil and:[tops notEmpty]) ifTrue:[
+ tops first getKeyboardFocus
+ ]
+ ].
+
+ "
+ restore cursors in the main group & flush its buffered key & mouse events
+ "
+ mainGroup restoreCursors.
"/ mainGroup sensor flushUserEvents.
- ]
- ]
- ].
+ ]
+ ]
+ ].
]
"Created: 10.12.1995 / 14:06:14 / cg"
@@ -7942,6 +7944,6 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.287 1998-12-05 13:42:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.288 1999-01-20 19:28:37 cg Exp $'
! !
SimpleView initialize!