RadioButton.st
changeset 0 e6a541c1c0eb
child 3 9d7eefb5e69f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RadioButton.st	Fri Jul 16 11:44:44 1993 +0200
@@ -0,0 +1,61 @@
+"
+ 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.
+"
+
+Toggle subclass:#RadioButton
+       instanceVariableNames:''
+       classVariableNames:''
+       poolDictionaries:''
+       category:'Views-Interactors'
+!
+
+RadioButton comment:'
+
+COPYRIGHT (c) 1991 by Claus Gittinger
+	      All Rights Reserved
+
+like a Toggle, but do not turn off when pressed again, instead only
+turn off when another RadioButton is pressed (see RadioButtonGroup).
+
+@(#)RButton.st	3.1 92/08/23
+written fall 91 by claus
+'!
+
+!RadioButton methodsFor:'destroying'!
+
+destroy
+    self release.
+    super destroy
+! !
+
+!RadioButton methodsFor:'changing state'!
+
+toggle
+    "in addition to toggling, notify RadioButtonGroup"
+
+    enabled ifTrue:[
+	super toggle.
+	pressed ifTrue:[
+	    self changed
+	]
+    ]
+! !
+
+!RadioButton methodsFor:'events'!
+
+buttonPress:button x:x y:y
+    "radiobuttons change only off-to-on; turning off is done by other
+     buttons"
+
+    pressed ifFalse:[
+	self toggle
+    ]
+! !