"
COPYRIGHT (c) 1995 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.
"
ButtonController subclass:#ToggleController
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Interface-Support'
!
!ToggleController class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 1995 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/libwidg/Attic/ToggleC.st,v 1.2 1995-02-17 13:23:13 claus Exp $
"
!
documentation
"
ToggleControllers redefine some of ButtonControllers behavior;
user interaction: they always triggerOnDown, and ignore buttonrelease.
Finally, every buttonPress leads to a toggle action.
"
! !
!ToggleController methodsFor:'initialization '!
initialize
super initialize.
triggerOnDown := true
! !
!ToggleController methodsFor:'event handling'!
buttonRelease:button x:x y:y
((button == 1) or:[button == #select]) ifFalse:[
^ super buttonRelease:button x:x y:y
].
"ignore"
!
buttonPress:button x:x y:y
((button == 1) or:[button == #select]) ifTrue:[
view toggle
] ifFalse:[
^ super buttonPress:button x:x y:y
].
! !