ControllerWithMenu.st
author Claus Gittinger <cg@exept.de>
Sat, 15 Nov 1997 14:40:12 +0100
changeset 1956 d15780bd1b47
parent 1150 a3d2fa5c5e6a
child 4381 4d4ea82cf007
permissions -rw-r--r--
*** empty log message ***

"
 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.
"
!

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'!

menu
    "can be redefined in subclasses"

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

menuHolder
    ^ menuHolder
!

menuHolder:aValueHolder
    menuHolder := aValueHolder
!

performer 
    ^ performer 
!

performer:anObject
    performer  := anObject
! !

!ControllerWithMenu methodsFor:'events'!

yellowButtonActivity
    |m selection|

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

!ControllerWithMenu methodsFor:'initialization'!

initialize
    "I am the default menu performer"

    performer := self.
    menuHolder := nil asValue
! !

!ControllerWithMenu class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview/ControllerWithMenu.st,v 1.8 1997-11-15 13:39:30 cg Exp $'
! !