#BUGFIX by cg
class: View
added: #defaultMenuPerformer
avoid strings as defaultMenuPerformer (TextViews)
comment/format in: #menuPerformer:
changed:
#menuPerformer
#model:
--- a/View.st Mon Apr 01 15:11:06 2019 +0200
+++ b/View.st Wed Apr 03 09:46:43 2019 +0200
@@ -284,6 +284,24 @@
!View methodsFor:'accessing-menus'!
+defaultMenuPerformer
+ "the stuff below tries to make for a reasonable
+ default, in case the menuPerformer was NOT set explicitely
+ (you should not depend on this in your application)"
+
+ (model isNil
+ or:[model isValueModel
+ or:[model isBlock
+ or:[model isString]]]
+ ) ifTrue:[
+ "/ a simple holder-model. Do not send menuMessages to it
+ ^ self application ? self
+ ].
+ ^ model
+
+ "Created: / 03-04-2019 / 09:42:37 / Claus Gittinger"
+!
+
menuHolder
"who has the menu ?
If no explicit menuHolder was defined, its the model if I have one.
@@ -333,24 +351,15 @@
The menuPerformer gets messages from the menu"
menuPerformer notNil ifTrue:[^ menuPerformer].
-
- "/ the stuff below tries to make for a reasonable
- "/ default, in case the menuPerformer was NOT set explicitely
- "/ (you should not depend on this in your application)
- (model isNil
- or:[model isValueModel
- or:[model isBlock]]) ifTrue:[
- "/ a simple holder-model. Do not send menuMessages to it
- ^ self application ? self
- ].
- ^ model
+ ^ self defaultMenuPerformer
"Modified (format): / 29-06-2017 / 12:08:58 / mawalch"
+ "Modified: / 03-04-2019 / 09:43:34 / Claus Gittinger"
!
menuPerformer:anObject
"change the one that does the menu actions.
- See the comment in SimpleView>>activateMenu on who gets the menus
+ See the comment in SimpleView>>activateMenu on who gets the menu's
message."
menuPerformer := anObject
@@ -379,7 +388,8 @@
top open.
"
- "Created: 23.12.1996 / 13:57:28 / cg"
+ "Created: / 23-12-1996 / 13:57:28 / cg"
+ "Modified (comment): / 03-04-2019 / 08:54:30 / Claus Gittinger"
!
performer:anObject
@@ -499,9 +509,12 @@
"/ ST80 kludge start
(menuPerformer == self
- and:[menuHolder == self
- and:[model isValueModel not]]) ifTrue:[
- menuPerformer := menuHolder := model
+ and:[menuHolder == self
+ and:[model isValueModel not
+ and:[model isString not
+ ]]]) ifTrue:[
+ self menuPerformer:model.
+ self menuHolder:model.
].
"/ ST80 kludge end.
@@ -512,7 +525,8 @@
controller model:aModel
].
- "Modified: 28.2.1997 / 19:23:06 / cg"
+ "Modified: / 28-02-1997 / 19:23:06 / cg"
+ "Modified: / 03-04-2019 / 09:44:19 / Claus Gittinger"
!
modelInterface