BBjRadioGroup::getName

Description

In BBj 23.00 and higher, this method returns the name of the BBjRadioGroup.

Syntax

Return Value

Method

string

getName()

Parameters

None.

Return Value

Returns the name previously set with BBjRadioGroup::setName().

Remarks

Returns "" if no value has been explicitly set.

Example

rem ' BBjRadioGroup

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,800,500,"BBjRadioGroup",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")

rem ' RadioGroup 1
rb1! = window!.addRadioButton(101,25,25,150,25,"RadioButton1",$0020$)
rb1!.setCallback(rb1!.ON_CHECK_ON,"event")
rb1!.setCallback(rb1!.ON_CHECK_OFF,"event")
rb2! = window!.addRadioButton(102,25,50,150,25,"RadioButton2",$0020$)
rb2!.setCallback(rb2!.ON_CHECK_ON,"event")
rb2!.setCallback(rb2!.ON_CHECK_OFF,"event")
rb3! = window!.addRadioButton(103,25,75,150,25,"RadioButton3",$0020$)
rb3!.setCallback(rb3!.ON_CHECK_ON,"event")
rb3!.setCallback(rb3!.ON_CHECK_OFF,"event")
rb4! = window!.addRadioButton(104,25,100,150,25,"RadioButton4",$0020$)
rb4!.setCallback(rb4!.ON_CHECK_ON,"event")
rb4!.setCallback(rb4!.ON_CHECK_OFF,"event")
rg1! = window!.addRadioGroup()
rg1!.setName("RadioGroup1",err=*next)
rg1!.add(rb1!)
rg1!.add(rb2!)
rg1!.add(rb3!)
rg1!.add(rb4!)

rem ' RadioGroup 2
rb5! = window!.addRadioButton(105,200,25,150,25,"RadioButton5",$0020$)
rb5!.setCallback(rb5!.ON_CHECK_ON,"event")
rb5!.setCallback(rb5!.ON_CHECK_OFF,"event")
rb6! = window!.addRadioButton(106,200,50,150,25,"RadioButton6",$0020$)
rb6!.setCallback(rb6!.ON_CHECK_ON,"event")
rb6!.setCallback(rb6!.ON_CHECK_OFF,"event")
rb7! = window!.addRadioButton(107,200,75,150,25,"RadioButton7",$0020$)
rb7!.setCallback(rb7!.ON_CHECK_ON,"event")
rb7!.setCallback(rb7!.ON_CHECK_OFF,"event")
rb8! = window!.addRadioButton(108,200,100,150,25,"RadioButton8",$0020$)
rb8!.setCallback(rb8!.ON_CHECK_ON,"event")
rb8!.setCallback(rb8!.ON_CHECK_OFF,"event")
rg2! = window!.addRadioGroup()
rg2!.setName("RadioGroup2",err=*next)
rg2!.add(rb5!)
rg2!.add(rb6!)
rg2!.add(rb7!)
rg2!.add(rb8!)

rem ' This BBjRadioGroup event is available in BBj 23.
rg1!.setCallback(rg1!.ON_SELECTION_CHANGE,"group",err=*next)
rg2!.setCallback(rg2!.ON_SELECTION_CHANGE,"group",err=*next)
events! = window!.addCEdit(900,25,150,750,325,$$,$0184$)
process_events

eoj:
release

resize:
    event! = sysgui!.getLastEvent()
    width = event!.getWidth()
    height = event!.getHeight()
    events!.setSize(width-50,height-175)
return

event:
    event! = sysgui!.getLastEvent()
    msg$ = event!.getEventName()+" "+event!.getRadioButton().getText()
    msg$ = msg$ + " " + event!.getRadioButton().getRadioGroup().getName(err=*next)
    print msg$
    events!.addParagraph(-1,msg$)
    events!.highlight(-1,0,-1,0)
return

group:
    event! = sysgui!.getLastEvent()
    group! = event!.getRadioGroup()
    selected! = event!.getSelected()
    if selected!=null() then selected$ = "" else selected$ = selected!.getText()
    deselected! = event!.getDeselected()
    if deselected!=null() then deselected$ = "" else deselected$ = deselected!.getText()
    msg$ = event!.getEventName()+" "+group!.getName(err=*next)
    msg$ = msg$+" selected="+selected$+" deselected="+deselected$
    print msg$
    events!.addParagraph(-1,msg$)
    events!.highlight(-1,0,-1,0)
return

See Also

BBjAPI

BBjSysGui

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.