SimpleView.st
changeset 8653 4d98ee627e6a
parent 8634 e49cd74df70c
child 8657 98885a2f2631
equal deleted inserted replaced
8652:5bc99411c4bd 8653:4d98ee627e6a
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  8455           Without this, you had to redefine and forward all of those
  8453           Without this, you had to redefine and forward all of those
  8456           messages in the performer."
  8454           messages in the performer."
  8457 
  8455 
  8458     |menu menuPerformer actionSelector prevReceiver wg|
  8456     |menu menuPerformer actionSelector prevReceiver wg|
  8459 
  8457 
  8460     self middleButtonMenu isNil ifTrue:[
  8458     (menu := self middleButtonMenu) notNil ifTrue:[
  8461         "
  8459         "/
  8462          try ST-80 style menus first:
  8460         "/ old style static menu
  8463          if there is a model, and a menuMessage is defined,
  8461         "/
  8464          ask model for the menu and launch that if non-nil.
  8462         self activateMenu:menu
  8465         "
  8463     ] ifFalse:[    
       
  8464         "/ try ST-80 style menus first:
       
  8465         "/ if there is a model, and a menuMessage is defined,
       
  8466         "/ ask model for the menu and launch that if non-nil.
  8466         menu := self yellowButtonMenu.
  8467         menu := self yellowButtonMenu.
  8467         menu notNil ifTrue:[
  8468         menu notNil ifTrue:[
  8468             "
  8469             "/ got one, launch the menu. 
  8469              got one, launch the menu. It is supposed
  8470             "/ It is supposed to return an actionSelector.
  8470              to return an actionSelector.
       
  8471             "
       
  8472             menuPerformer := self menuPerformer value.
  8471             menuPerformer := self menuPerformer value.
  8473 
  8472 
  8474             "/ could be a spec ...
  8473             "/ could be a spec ...
  8475             menu isArray ifTrue:[
  8474             menu isArray ifTrue:[
  8476                 |menuHolder|
  8475                 |menuHolder|
  8505                 "/ (menu isKindOf:Menu) ifFalse:[
  8504                 "/ (menu isKindOf:Menu) ifFalse:[
  8506                 (menu respondsTo:#menuPerformer:) ifTrue:[
  8505                 (menu respondsTo:#menuPerformer:) ifTrue:[
  8507                     menu receiver:self.    "/ really ?
  8506                     menu receiver:self.    "/ really ?
  8508                     menu menuPerformer:menuPerformer.
  8507                     menu menuPerformer:menuPerformer.
  8509                 ] ifFalse:[
  8508                 ] ifFalse:[
  8510                 "/ ] ifTrue:[
       
  8511                     "/ new style menu
  8509                     "/ new style menu
  8512                     menu receiver:menuPerformer.
  8510                     menu receiver:menuPerformer.
  8513                 ]
  8511                 ]
  8514             ].
  8512             ].
  8515 
  8513 
  8525             ].
  8523             ].
  8526 
  8524 
  8527             (actionSelector notNil and:[actionSelector isSymbol]) ifTrue:[
  8525             (actionSelector notNil and:[actionSelector isSymbol]) ifTrue:[
  8528                 self dispatchMenuSelection:actionSelector to: menuPerformer.
  8526                 self dispatchMenuSelection:actionSelector to: menuPerformer.
  8529             ].
  8527             ].
  8530 
       
  8531             menu receiver:prevReceiver.
  8528             menu receiver:prevReceiver.
  8532 
       
  8533             ^ self
  8529             ^ self
  8534         ].
  8530         ].
  8535     ].
  8531     ].
  8536 
       
  8537     "/
       
  8538     "/ old style static menu
       
  8539     "/
       
  8540     super activateMenu
       
  8541 
  8532 
  8542     "Created: / 01-03-1996 / 13:24:18 / cg"
  8533     "Created: / 01-03-1996 / 13:24:18 / cg"
  8543     "Modified: / 14-08-1998 / 18:09:31 / cg"
  8534     "Modified: / 14-08-1998 / 18:09:31 / cg"
  8544     "Modified: / 08-03-2018 / 21:51:07 / mawalch"
  8535     "Modified: / 08-03-2018 / 21:51:07 / mawalch"
       
  8536     "Modified: / 02-03-2019 / 11:42:51 / Claus Gittinger"
  8545 !
  8537 !
  8546 
  8538 
  8547 dispatchMenuSelection:menuSelection to:aMenuPerformerOrNil
  8539 dispatchMenuSelection:menuSelection to:aMenuPerformerOrNil
  8548     "dispatch a menu message.
  8540     "dispatch a menu message.
  8549      This code will move into the controller ASAP"
  8541      This code will move into the controller ASAP"