128
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
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 |
|
104
|
13 |
'From Smalltalk/X, Version:2.10.5 on 14-mar-1995 at 11:07:27 am'!
|
|
14 |
|
|
15 |
ToggleController subclass:#RadioButtonController
|
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
126
|
19 |
category:'Interface-Support-Controllers'
|
104
|
20 |
!
|
|
21 |
|
128
|
22 |
!RadioButtonController class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
|
38 |
version
|
|
39 |
"
|
|
40 |
$Header: /cvs/stx/stx/libwidg/RadioButtonController.st,v 1.3 1995-05-17 12:25:53 claus Exp $
|
|
41 |
"
|
|
42 |
!
|
|
43 |
|
|
44 |
documentation
|
|
45 |
"
|
|
46 |
RadioButtonControllers redefine the response to a button-click.
|
|
47 |
While toggles (i.e. ToggleControllers) change state with every click,
|
|
48 |
radioButtons will only do so for an off-to-on transition.
|
|
49 |
They will NEVER turn themselfes off with a click.
|
|
50 |
To turn a radioButton off, another button in its buttonGroup must
|
|
51 |
be turned on and thereby (via the buttonGroup) turn the first button off.
|
|
52 |
|
|
53 |
You can place both toggles (for 'zero-or-one-on' behavior) or
|
|
54 |
radiobuttons (for 'one-on' behavior) into a buttongroup.
|
|
55 |
"
|
|
56 |
! !
|
|
57 |
|
104
|
58 |
!RadioButtonController methodsFor:'event handling'!
|
|
59 |
|
|
60 |
buttonPress:button x:x y:y
|
|
61 |
"radiobuttons change only off-to-on; turning off is done by other
|
128
|
62 |
buttons."
|
104
|
63 |
|
|
64 |
pressed ifFalse:[
|
126
|
65 |
view toggle
|
104
|
66 |
]
|
|
67 |
! !
|
|
68 |
|