RadioButton.st
author Claus Gittinger <cg@exept.de>
Tue, 28 May 1996 22:11:10 +0200
changeset 711 c830bb66598b
parent 593 86dd024ed773
child 1087 171cdcfe0274
permissions -rw-r--r--
use new #invalidate instead of redraw

"
 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 class methodsFor:'documentation'!

copyright
"
 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.
"
!

documentation
"
    like a Toggle, but do not turn off when pressed again, instead only
    turn off when another RadioButton is pressed (see RadioButtonGroup).

    written fall 91 by claus

    [author:]
        Claus Gittinger
"
!

examples 
"
  See more examples in RadioButtonGroup class>>examples

  example1: one on behavior (using RadioButtons)
                                                                        [exBegin]
    |top panel b group|

    top := StandardSystemView new.
    top extent:200@200.

    panel := HorizontalPanelView
                origin:0.0@0.0
                corner:1.0@1.0
                    in:top.

    group := RadioButtonGroup new.

    b := RadioButton label:'am' in:panel.
    group add:b.

    b := RadioButton label:'fm' in:panel.
    group add:b.

    b := RadioButton label:'off' in:panel.
    group add:b.

    top open
                                                                        [exEnd]


  example2: zero or one on behavior (using Toggles)
                                                                        [exBegin]
    |top panel b group|

    top := StandardSystemView new.
    top extent:200@200.

    panel := HorizontalPanelView
                origin:0.0@0.0
                corner:1.0@1.0
                    in:top.

    group := RadioButtonGroup new.

    b := Toggle label:'am' in:panel.
    group add:b.

    b := Toggle label:'fm' in:panel.
    group add:b.

    b := Toggle label:'off' in:panel.
    group add:b.

    top open
                                                                        [exEnd]
"
! !

!RadioButton methodsFor:'initialization'!

defaultControllerClass
    ^ RadioButtonController
! !

!RadioButton class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/RadioButton.st,v 1.13 1996-04-27 18:18:14 cg Exp $'
! !