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
|
86
|
14 |
instanceVariableNames:'group'
|
0
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Interactors'
|
|
18 |
!
|
|
19 |
|
|
20 |
RadioButton comment:'
|
5
|
21 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
22 |
All Rights Reserved
|
|
23 |
|
86
|
24 |
$Header: /cvs/stx/stx/libwidg/RadioButton.st,v 1.7 1995-02-16 03:12:59 claus Exp $
|
38
|
25 |
'!
|
|
26 |
|
|
27 |
!RadioButton 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 |
"
|
86
|
45 |
$Header: /cvs/stx/stx/libwidg/RadioButton.st,v 1.7 1995-02-16 03:12:59 claus Exp $
|
38
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
like a Toggle, but do not turn off when pressed again, instead only
|
|
52 |
turn off when another RadioButton is pressed (see RadioButtonGroup).
|
|
53 |
|
|
54 |
written fall 91 by claus
|
|
55 |
"
|
86
|
56 |
!
|
|
57 |
|
|
58 |
examples
|
|
59 |
"
|
|
60 |
|top panel b group|
|
|
61 |
|
|
62 |
top := StandardSystemView new.
|
|
63 |
top extent:200@200.
|
|
64 |
|
|
65 |
panel := HorizontalPanelView
|
|
66 |
origin:0.0@0.0
|
|
67 |
corner:1.0@1.0
|
|
68 |
in:top.
|
|
69 |
|
|
70 |
group := RadioButtonGroup new.
|
|
71 |
|
|
72 |
b := RadioButton label:'am' in:panel.
|
|
73 |
group add:b.
|
|
74 |
|
|
75 |
b := RadioButton label:'fm' in:panel.
|
|
76 |
group add:b.
|
|
77 |
|
|
78 |
b := RadioButton label:'off' in:panel.
|
|
79 |
group add:b.
|
|
80 |
|
|
81 |
top open
|
|
82 |
"
|
38
|
83 |
! !
|
0
|
84 |
|
|
85 |
!RadioButton methodsFor:'destroying'!
|
|
86 |
|
|
87 |
destroy
|
|
88 |
self release.
|
|
89 |
super destroy
|
|
90 |
! !
|
|
91 |
|
86
|
92 |
!RadioButton methodsFor:'accessing '!
|
0
|
93 |
|
86
|
94 |
group
|
|
95 |
"return the radioButtonGroup in which I am"
|
0
|
96 |
|
86
|
97 |
^ group
|
|
98 |
!
|
|
99 |
|
|
100 |
group:aButtonGroup
|
|
101 |
"set the radioButtonGroup in which I am"
|
|
102 |
|
|
103 |
group := aButtonGroup
|
0
|
104 |
! !
|
|
105 |
|
|
106 |
!RadioButton methodsFor:'events'!
|
|
107 |
|
|
108 |
buttonPress:button x:x y:y
|
|
109 |
"radiobuttons change only off-to-on; turning off is done by other
|
|
110 |
buttons"
|
|
111 |
|
77
|
112 |
controller pressed ifFalse:[
|
0
|
113 |
self toggle
|
|
114 |
]
|
|
115 |
! !
|