0
|
1 |
"
|
5
|
2 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
7
|
13 |
OrderedCollection subclass:#RadioButtonGroup
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Support'
|
0
|
18 |
!
|
|
19 |
|
|
20 |
RadioButtonGroup comment:'
|
5
|
21 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
22 |
All Rights Reserved
|
|
23 |
|
38
|
24 |
$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.5 1994-08-07 13:23:13 claus Exp $
|
|
25 |
'!
|
|
26 |
|
|
27 |
!RadioButtonGroup class methodsFor:'documentation '!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
|
32 |
All Rights Reserved
|
0
|
33 |
|
38
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
version
|
|
44 |
"
|
|
45 |
$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.5 1994-08-07 13:23:13 claus Exp $
|
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
RadioButtonGroups control the interaction between RadioButtons
|
|
52 |
turning off other button(s) when one of the group is pressed.
|
|
53 |
"
|
|
54 |
! !
|
0
|
55 |
|
|
56 |
!RadioButtonGroup methodsFor:'adding / removing'!
|
|
57 |
|
|
58 |
add:aRadioButton
|
|
59 |
super add:aRadioButton.
|
|
60 |
aRadioButton addDependent:self
|
|
61 |
! !
|
|
62 |
|
|
63 |
!RadioButtonGroup methodsFor:'update'!
|
|
64 |
|
|
65 |
update:changedButton
|
|
66 |
"a RadioButton in this group has changed - notify the others"
|
|
67 |
|
38
|
68 |
"in case we have a toggle in the group,
|
|
69 |
and it has been turned off - turn it on again
|
|
70 |
"
|
|
71 |
changedButton isOn ifFalse:[
|
|
72 |
changedButton toggleNoAction.
|
|
73 |
^ self
|
|
74 |
].
|
0
|
75 |
self do:[:aButton |
|
|
76 |
(aButton == changedButton) ifFalse:[
|
|
77 |
aButton isOn ifTrue:[
|
|
78 |
aButton turnOff
|
|
79 |
]
|
|
80 |
]
|
|
81 |
]
|
|
82 |
|
|
83 |
! !
|