grabbing changed to restore grab at hiding time,
to allow popups in popups and ext-comboBoxes
--- a/MenuView.st Wed Dec 08 21:38:40 1999 +0100
+++ b/MenuView.st Wed Dec 08 21:42:23 1999 +0100
@@ -1708,7 +1708,7 @@
aKey == #Escape ifTrue:[
masterView notNil ifTrue:[
masterView hideSubmenu.
- masterView regainControl.
+"/ masterView regainControl.
masterView hide.
].
superView hide.
@@ -2029,148 +2029,148 @@
performSelectedAction
|theSelector theAction isCheck checkOn val idx didItHere|
- (superView notNil and:[superView isPopUpView]) ifTrue:[superView hide].
+ (superView notNil and:[superView isPopUpView]) ifTrue:[superView hideForAction].
superMenu notNil ifTrue:[superMenu submenuTriggered].
idx := selection.
idx notNil ifTrue:[
- (subMenus isNil or:[(subMenus at:idx) isNil]) ifTrue:[
- didItHere := false.
-
- self showActive.
- [
- superMenu notNil ifTrue:[
- superMenu showActive
- ].
-
- val := idx.
- args notNil ifTrue:[
- val := args at:idx
- ].
-
- isCheck := false.
- onOffFlags notNil ifTrue:[
- onOffFlags size >= idx ifTrue:[
- checkOn := (onOffFlags at:idx).
- isCheck := checkOn notNil.
- isCheck ifTrue:[
- checkOn := val := checkOn not.
- onOffFlags at:idx put:checkOn.
- ]
- ]
- ].
-
- "
- ST-80 style model notification
- "
- self sendChangeMessageWith:val.
-
- "
- item actions or selectors-array
- "
- device activePointerGrab == self ifTrue:[
- device ungrabPointer.
- ].
-
- actions notNil ifTrue:[
- theAction := actions at:idx ifAbsent:nil.
- ].
-
- theAction isNil ifTrue: [
- selectors notNil ifTrue: [
-
- "/ selectors may be:
- "/ - a single selector used for all items
- "/ - an array of selectors used per item
-
- selectors isSymbol ifTrue:[
- theSelector := selectors
- ] ifFalse:[
- (idx notNil
- and:[idx <= selectors size]) ifTrue:[
- theSelector := selectors at:idx
- ]
- ].
- ].
- ].
-
- (theSelector notNil
- or:[theAction notNil]) ifTrue:[
- AbortSignal handle:[:ex |
- ex return
- ] do:[
- |theReceiver|
-
- didItHere := true.
- theAction notNil ifTrue:[
- theAction numArgs == 0 ifTrue:[
- theAction value
- ] ifFalse:[
- theAction value:val
- ].
- ] ifFalse:[
- "/ support for ST-80 style message splitting:
- "/ if there is a menuPerformer it gets the
- "/ message (if understood).
- "/ Otherwise if there is a model, try that.
- "/ Finally, if there is a receiver,
- "/ its sent to that one.
-
- theReceiver := menuPerformer.
- (theReceiver isNil
- or:[(theReceiver respondsTo:theSelector) not])
- ifTrue:[
- theReceiver := model.
- ].
- (theReceiver isNil
- or:[(theReceiver respondsTo:theSelector) not])
- ifTrue:[
- theReceiver := receiver.
- ].
-
- theSelector numArgs == 0 ifTrue:[
- theReceiver perform:theSelector
- ] ifFalse:[
- isCheck ifTrue:[
- self redrawLine:idx.
- val := checkOn.
- ].
+ (subMenus isNil or:[(subMenus at:idx) isNil]) ifTrue:[
+ didItHere := false.
+
+ self showActive.
+ [
+ superMenu notNil ifTrue:[
+ superMenu showActive
+ ].
+
+ val := idx.
+ args notNil ifTrue:[
+ val := args at:idx
+ ].
+
+ isCheck := false.
+ onOffFlags notNil ifTrue:[
+ onOffFlags size >= idx ifTrue:[
+ checkOn := (onOffFlags at:idx).
+ isCheck := checkOn notNil.
+ isCheck ifTrue:[
+ checkOn := val := checkOn not.
+ onOffFlags at:idx put:checkOn.
+ ]
+ ]
+ ].
+
+ "
+ ST-80 style model notification
+ "
+ self sendChangeMessageWith:val.
+
+ "
+ item actions or selectors-array
+ "
+ device activePointerGrab == self ifTrue:[
+ device ungrabPointer.
+ ].
+
+ actions notNil ifTrue:[
+ theAction := actions at:idx ifAbsent:nil.
+ ].
+
+ theAction isNil ifTrue: [
+ selectors notNil ifTrue: [
+
+ "/ selectors may be:
+ "/ - a single selector used for all items
+ "/ - an array of selectors used per item
+
+ selectors isSymbol ifTrue:[
+ theSelector := selectors
+ ] ifFalse:[
+ (idx notNil
+ and:[idx <= selectors size]) ifTrue:[
+ theSelector := selectors at:idx
+ ]
+ ].
+ ].
+ ].
+
+ (theSelector notNil
+ or:[theAction notNil]) ifTrue:[
+ AbortSignal handle:[:ex |
+ ex return
+ ] do:[
+ |theReceiver|
+
+ didItHere := true.
+ theAction notNil ifTrue:[
+ theAction numArgs == 0 ifTrue:[
+ theAction value
+ ] ifFalse:[
+ theAction value:val
+ ].
+ ] ifFalse:[
+ "/ support for ST-80 style message splitting:
+ "/ if there is a menuPerformer it gets the
+ "/ message (if understood).
+ "/ Otherwise if there is a model, try that.
+ "/ Finally, if there is a receiver,
+ "/ its sent to that one.
+
+ theReceiver := menuPerformer.
+ (theReceiver isNil
+ or:[(theReceiver respondsTo:theSelector) not])
+ ifTrue:[
+ theReceiver := model.
+ ].
+ (theReceiver isNil
+ or:[(theReceiver respondsTo:theSelector) not])
+ ifTrue:[
+ theReceiver := receiver.
+ ].
+
+ theSelector numArgs == 0 ifTrue:[
+ theReceiver perform:theSelector
+ ] ifFalse:[
+ isCheck ifTrue:[
+ self redrawLine:idx.
+ val := checkOn.
+ ].
- theReceiver perform:theSelector with:val
- ]
- ]
-
- ]
- ].
-
- "
- any action-block ?
- "
- actionBlock notNil ifTrue:[
- AbortSignal handle:[:ex |
- ex return
- ] do:[
- didItHere ifTrue:[
- val := nil
- ].
- actionBlock numArgs == 1 ifTrue:[
- actionBlock value:val
- ] ifFalse:[
- actionBlock value:self value:val
- ]
- ]
- ].
-
- ] valueNowOrOnUnwindDo:[
- realized ifTrue:[
- self showPassive.
- ].
- superMenu notNil ifTrue:[
- superMenu showPassive
- ]
- ].
- ].
+ theReceiver perform:theSelector with:val
+ ]
+ ]
+
+ ]
+ ].
+
+ "
+ any action-block ?
+ "
+ actionBlock notNil ifTrue:[
+ AbortSignal handle:[:ex |
+ ex return
+ ] do:[
+ didItHere ifTrue:[
+ val := nil
+ ].
+ actionBlock numArgs == 1 ifTrue:[
+ actionBlock value:val
+ ] ifFalse:[
+ actionBlock value:self value:val
+ ]
+ ]
+ ].
+
+ ] valueNowOrOnUnwindDo:[
+ realized ifTrue:[
+ self showPassive.
+ ].
+ superMenu notNil ifTrue:[
+ superMenu showPassive
+ ]
+ ].
+ ].
]
"Created: 4.3.1996 / 11:19:22 / cg"
@@ -2735,5 +2735,5 @@
!MenuView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.124 1999-08-18 14:40:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.125 1999-12-08 20:42:23 ca Exp $'
! !