RadioButtonGroup.st
author claus
Fri, 16 Jul 1993 11:44:44 +0200
changeset 0 e6a541c1c0eb
child 3 9d7eefb5e69f
permissions -rw-r--r--
Initial revision

"
 COPYRIGHT (c) 1991 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.
"

VariableArray subclass:#RadioButtonGroup
	 instanceVariableNames:'buttonGroup'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Views-Support'
!

RadioButtonGroup comment:'

COPYRIGHT (c) 1991 by Claus Gittinger
              All Rights Reserved

RadioButtonGroups controll the interaction between RadioButtons
turning off other button(s) when one of the group is pressed.

@(#)RButtGrp.st	3.1 92/08/23
written nov 91 by claus
'!

!RadioButtonGroup methodsFor:'adding / removing'!

add:aRadioButton
    super add:aRadioButton.
    aRadioButton addDependent:self
! !

!RadioButtonGroup methodsFor:'update'!

update:changedButton
    "a RadioButton in this group has changed - notify the others"

    self do:[:aButton |
        (aButton == changedButton) ifFalse:[
            aButton isOn ifTrue:[
                aButton turnOff
            ]
        ]
    ]

! !