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 |
|
|
13 |
Toggle subclass:#RadioButton
|
585
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Interactors'
|
0
|
18 |
!
|
|
19 |
|
38
|
20 |
!RadioButton class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
|
25 |
All Rights Reserved
|
0
|
26 |
|
38
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
like a Toggle, but do not turn off when pressed again, instead only
|
|
39 |
turn off when another RadioButton is pressed (see RadioButtonGroup).
|
|
40 |
|
|
41 |
written fall 91 by claus
|
585
|
42 |
|
|
43 |
[author:]
|
|
44 |
Claus Gittinger
|
38
|
45 |
"
|
86
|
46 |
!
|
|
47 |
|
|
48 |
examples
|
|
49 |
"
|
119
|
50 |
See more examples in RadioButtonGroup class>>examples
|
|
51 |
|
|
52 |
example1: one on behavior (using RadioButtons)
|
593
|
53 |
[exBegin]
|
86
|
54 |
|top panel b group|
|
|
55 |
|
|
56 |
top := StandardSystemView new.
|
|
57 |
top extent:200@200.
|
|
58 |
|
|
59 |
panel := HorizontalPanelView
|
593
|
60 |
origin:0.0@0.0
|
|
61 |
corner:1.0@1.0
|
|
62 |
in:top.
|
86
|
63 |
|
|
64 |
group := RadioButtonGroup new.
|
|
65 |
|
|
66 |
b := RadioButton label:'am' in:panel.
|
|
67 |
group add:b.
|
|
68 |
|
|
69 |
b := RadioButton label:'fm' in:panel.
|
|
70 |
group add:b.
|
|
71 |
|
|
72 |
b := RadioButton label:'off' in:panel.
|
|
73 |
group add:b.
|
|
74 |
|
1087
|
75 |
group value:1.
|
86
|
76 |
top open
|
593
|
77 |
[exEnd]
|
105
|
78 |
|
|
79 |
|
119
|
80 |
example2: zero or one on behavior (using Toggles)
|
593
|
81 |
[exBegin]
|
105
|
82 |
|top panel b group|
|
|
83 |
|
|
84 |
top := StandardSystemView new.
|
|
85 |
top extent:200@200.
|
|
86 |
|
|
87 |
panel := HorizontalPanelView
|
593
|
88 |
origin:0.0@0.0
|
|
89 |
corner:1.0@1.0
|
|
90 |
in:top.
|
105
|
91 |
|
|
92 |
group := RadioButtonGroup new.
|
|
93 |
|
|
94 |
b := Toggle label:'am' in:panel.
|
|
95 |
group add:b.
|
|
96 |
|
|
97 |
b := Toggle label:'fm' in:panel.
|
|
98 |
group add:b.
|
|
99 |
|
|
100 |
b := Toggle label:'off' in:panel.
|
|
101 |
group add:b.
|
|
102 |
|
1087
|
103 |
group value:1.
|
105
|
104 |
top open
|
593
|
105 |
[exEnd]
|
1087
|
106 |
|
|
107 |
|
|
108 |
a selectionInListView and a group displaying the same value:
|
|
109 |
[exBegin]
|
|
110 |
|top top2 panel b sv group selectionInList|
|
|
111 |
|
|
112 |
top := StandardSystemView extent:200@200.
|
|
113 |
|
|
114 |
panel := HorizontalPanelView
|
|
115 |
origin:0.0@0.0 corner:1.0@1.0 in:top.
|
|
116 |
|
|
117 |
group := RadioButtonGroup new.
|
|
118 |
selectionInList := SelectionInList new.
|
|
119 |
selectionInList list:#('am' 'fm' 'off').
|
|
120 |
selectionInList selectionIndexHolder:group.
|
|
121 |
|
|
122 |
b := Toggle label:'am' in:panel.
|
|
123 |
group add:b.
|
|
124 |
|
|
125 |
b := Toggle label:'fm' in:panel.
|
|
126 |
group add:b.
|
|
127 |
|
|
128 |
b := Toggle label:'off' in:panel.
|
|
129 |
group add:b.
|
|
130 |
|
|
131 |
group value:1.
|
|
132 |
top open.
|
|
133 |
|
|
134 |
top2 := StandardSystemView extent:200@200.
|
|
135 |
sv := SelectionInListView in:top2.
|
|
136 |
sv model:selectionInList.
|
|
137 |
sv origin:0.0@0.0 corner:1.0@1.0.
|
|
138 |
top2 open.
|
|
139 |
|
|
140 |
[exEnd]
|
86
|
141 |
"
|
38
|
142 |
! !
|
0
|
143 |
|
105
|
144 |
!RadioButton methodsFor:'initialization'!
|
0
|
145 |
|
105
|
146 |
defaultControllerClass
|
|
147 |
^ RadioButtonController
|
0
|
148 |
! !
|
|
149 |
|
205
|
150 |
!RadioButton class methodsFor:'documentation'!
|
|
151 |
|
|
152 |
version
|
1087
|
153 |
^ '$Header: /cvs/stx/stx/libwidg/RadioButton.st,v 1.14 1997-03-01 12:53:37 cg Exp $'
|
205
|
154 |
! !
|