ControllerWithMenu.st
author Claus Gittinger <cg@exept.de>
Sat, 11 Nov 1995 16:54:10 +0100
changeset 219 9ff0660f447f
parent 157 891eff44c2e7
child 1150 a3d2fa5c5e6a
permissions -rw-r--r--
uff - version methods changed to return stings

"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Controller subclass:#ControllerWithMenu
       instanceVariableNames:'menuHolder performer'
       classVariableNames:''
       poolDictionaries:''
       category:'Interface-Support-Controllers'
!

!ControllerWithMenu class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

version
    ^ '$Header: /cvs/stx/stx/libview/ControllerWithMenu.st,v 1.6 1995-11-11 15:48:50 cg Exp $'
!

documentation
"
    ControllerWithMenus is a very simple controller for a view with
    a middleButtonMenu.
    This class currently exists for ST-80 compatibility only.
"
! !

!ControllerWithMenu  methodsFor:'accessing'!

menuHolder:aValueHolder
    menuHolder := aValueHolder
!

menuHolder
    ^ menuHolder
!

performer 
    ^ performer 
!

performer:anObject
    performer  := anObject
!

menu
    "can be redefined in subclasses"

    menuHolder notNil ifTrue:[
	^ menuHolder value
    ].
    ^ nil
! !

!ControllerWithMenu  methodsFor:'events'!

yellowButtonActivity
    |m selection|

    (m := self menu) notNil ifTrue:[
	selection := self menu startUp.
	selection ~~ 0 ifTrue:[
	    self perform:selection
	]
    ]
! !