RadioButtonController.st
author Claus Gittinger <cg@exept.de>
Mon, 23 Oct 1995 21:07:01 +0100
changeset 164 5ab02ff0d9ae
parent 128 06a050529335
child 174 d80a6cc3f9b2
permissions -rw-r--r--
.

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

'From Smalltalk/X, Version:2.10.5 on 14-mar-1995 at 11:07:27 am'!

ToggleController subclass:#RadioButtonController
	 instanceVariableNames:''
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Interface-Support-Controllers'
!

!RadioButtonController 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/RadioButtonController.st,v 1.3 1995-05-17 12:25:53 claus Exp $
"
!

documentation
"
    RadioButtonControllers redefine the response to a button-click.
    While toggles (i.e. ToggleControllers) change state with every click,
    radioButtons will only do so for an off-to-on transition.
    They will NEVER turn themselfes off with a click.
    To turn a radioButton off, another button in its buttonGroup must
    be turned on and thereby (via the buttonGroup) turn the first button off.

    You can place both toggles (for 'zero-or-one-on' behavior) or
    radiobuttons (for 'one-on' behavior) into a buttongroup.
"
! !

!RadioButtonController methodsFor:'event handling'!

buttonPress:button x:x y:y
    "radiobuttons change only off-to-on; turning off is done by other
     buttons."

    pressed ifFalse:[
	view toggle
    ]
! !