RadioButtonGroup.st
author claus
Sat, 11 Dec 1993 02:51:34 +0100
changeset 7 15a9291b9bd0
parent 5 7b4fb1b170e5
child 38 4b9b70b2cc87
permissions -rw-r--r--
*** empty log message ***

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

OrderedCollection subclass:#RadioButtonGroup
         instanceVariableNames:''
         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.

$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.4 1993-12-11 01:48:03 claus Exp $
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
            ]
        ]
    ]

! !