--- a/MenuPanel.st Thu Oct 16 14:35:07 2008 +0200
+++ b/MenuPanel.st Thu Oct 16 16:35:52 2008 +0200
@@ -875,7 +875,6 @@
winGrp focusView:focusView.
].
self accept:item index:itemIdx toggle:tgState receiver:recv.
-
].
(item notNil
@@ -898,7 +897,7 @@
accept:anItem index:anIndex toggle:aState receiver:aReceiver
"accept an item"
- |value argument numArgs isValueModel rec args arg2
+ |selectorOrBlock argument numArgs isValueModel rec args arg2
app master fallBack|
anItem isNil ifTrue:[
@@ -910,7 +909,7 @@
self menuAdornmentAt:#hasPerformed put:isValueModel.
- (value := anItem value) isNil ifTrue:[
+ (selectorOrBlock := anItem value) isNil ifTrue:[
^ anIndex
].
@@ -918,13 +917,13 @@
argument := aState ? anItem
].
- value isSymbol ifFalse:[
+ selectorOrBlock isSymbol ifFalse:[
"/ a valueHolder or block
- (value respondsTo:#valueWithArguments:) ifFalse:[
- ^ value
- ].
-
- numArgs := value perform:#numArgs ifNotUnderstood:0.
+ (selectorOrBlock respondsTo:#valueWithArguments:) ifFalse:[
+ ^ selectorOrBlock
+ ].
+
+ numArgs := selectorOrBlock perform:#numArgs ifNotUnderstood:0.
numArgs == 0 ifTrue:[
args := nil
@@ -936,7 +935,7 @@
]
].
- value valueWithArguments:args.
+ selectorOrBlock valueWithArguments:args.
self menuAdornmentAt:#hasPerformed put:true.
^ anIndex
@@ -952,11 +951,11 @@
].
rec isNil ifTrue:[
- ^ value
+ ^ selectorOrBlock
].
isValueModel ifTrue:[
- rec value:value
+ rec value:selectorOrBlock
] ifFalse:[
arg2 := self.
@@ -967,14 +966,14 @@
"/ sigh.
(rec isView
- and:[(rec respondsTo:value) not
+ and:[(rec respondsTo:selectorOrBlock) not
and:[(app := rec application) ~~ rec
and:[app notNil]]]) ifTrue:[
arg2 := rec controller. "/ the Views controller
rec := app.
].
- (numArgs := value numArgs) == 0 ifTrue:[
+ (numArgs := selectorOrBlock numArgs) == 0 ifTrue:[
args := nil
] ifFalse:[
numArgs == 1 ifTrue:[
@@ -992,18 +991,18 @@
master := rec perform:#masterApplication ifNotUnderstood:nil.
master notNil ifTrue:[
rec := master.
- rec perform:value withArguments:args ifNotUnderstood:fallBack
+ rec perform:selectorOrBlock withArguments:args ifNotUnderstood:fallBack
] ifFalse:[
self
- error:'unimplemented (or error in) menu message: ' , value
+ error:'unimplemented (or error in) menu message: ' , selectorOrBlock
mayProceed:true
].
].
- rec perform:value withArguments:args ifNotUnderstood:fallBack.
+ rec perform:selectorOrBlock withArguments:args ifNotUnderstood:fallBack.
].
self menuAdornmentAt:#hasPerformed put:true.
- ^ value
+ ^ selectorOrBlock
"Modified: / 19.2.2000 / 11:08:22 / cg"
!
@@ -5458,7 +5457,7 @@
self hasSubmenu ifFalse:[ ^ true ].
self hasDelayedMenu ifFalse:[^ false ].
- ^ subMenu isNil or:[subMenu shown not]
+ ^ subMenu isNil or:[subMenu shown not]
!
toggleIndication
@@ -8118,7 +8117,7 @@
!MenuPanel class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.476 2008-07-22 08:25:23 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.477 2008-10-16 14:35:52 cg Exp $'
! !
MenuPanel initialize!