--- a/RadioButtonGroup.st Sun Apr 02 13:43:38 1995 +0200
+++ b/RadioButtonGroup.st Tue Apr 11 18:24:40 1995 +0200
@@ -23,7 +23,7 @@
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.9 1995-03-18 05:15:46 claus Exp $
+$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.10 1995-04-11 16:24:11 claus Exp $
'!
!RadioButtonGroup class methodsFor:'documentation '!
@@ -44,7 +44,7 @@
version
"
-$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.9 1995-03-18 05:15:46 claus Exp $
+$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.10 1995-04-11 16:24:11 claus Exp $
"
!
@@ -64,6 +64,55 @@
b2 := RadioButton label:....
g add:b2
...
+
+ example (using Toggles for 'at most one-on behavior'):
+
+ |top panel toggle b g|
+
+ top := StandardSystemView new.
+ panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
+ g := RadioButtonGroup new.
+ b := Toggle label:'one' in:panel.
+ g add:b.
+ b := Toggle label:'two' in:panel.
+ g add:b.
+ b := Toggle label:'three' in:panel.
+ g add:b.
+ top extent:(panel preferedExtent).
+ top open.
+
+ example (using RadioButtons for 'one-on behavior'):
+
+ |top panel toggle b g|
+
+ top := StandardSystemView new.
+ panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
+ g := RadioButtonGroup new.
+ b := RadioButton label:'one' in:panel.
+ g add:b.
+ b := RadioButton label:'two' in:panel.
+ g add:b.
+ b := RadioButton label:'three' in:panel.
+ g add:b.
+ top extent:(panel preferedExtent).
+ top open.
+
+ example (same, with button 'two' initially on):
+
+ |top panel toggle b g|
+
+ top := StandardSystemView new.
+ panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
+ g := RadioButtonGroup new.
+ b := RadioButton label:'one' in:panel.
+ g add:b.
+ b := RadioButton label:'two' in:panel.
+ g add:b.
+ b turnOn.
+ b := RadioButton label:'three' in:panel.
+ g add:b.
+ top extent:(panel preferedExtent).
+ top open.
"
! !
@@ -91,31 +140,31 @@
"/ ^ self
"/ ].
self do:[:aButton |
- (aButton == changedButton) ifFalse:[
- aButton isOn ifTrue:[
- aButton turnOff
- ]
- ]
+ (aButton == changedButton) ifFalse:[
+ aButton isOn ifTrue:[
+ aButton turnOff
+ ]
+ ]
]
!
elementChanged:aToggle
self do:[:aButton |
- (aButton == aToggle) ifFalse:[
- aButton isOn ifTrue:[
- aButton turnOff
- ]
- ]
+ (aButton == aToggle) ifFalse:[
+ aButton isOn ifTrue:[
+ aButton turnOff
+ ]
+ ]
]
!
elementChanged:newValue from:aToggle
self do:[:aButton |
- (aButton == aToggle) ifFalse:[
- aButton isOn ifTrue:[
- aButton turnOff
- ]
- ]
+ (aButton == aToggle) ifFalse:[
+ aButton isOn ifTrue:[
+ aButton turnOff
+ ]
+ ]
]
! !