BBjWindow::addRadioGroup

 

Description

In BBj 3.0 and higher, this method creates an empty radio group.

Syntax

Return Value

Method

BBjRadioGroup

addRadioGroup()

Parameters

None.

Return Value

The BBjRadioGroup.

Remarks

None.

Example

REM Add a radio group to a window

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200
TITLE$="BBj Window"

REM Set the current context
mySysGui!.setContext(0)

REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

REM Add the radio buttons on the window
myRadioButton1! = myWindow!.addRadioButton(101,50,50,90,30,"Radio Button",$0000$)
myRadioButton2! = myWindow!.addRadioButton(102,50,100,90,30,"Radio Button",$0000$)
myRadioButton3! = myWindow!.addRadioButton(103,50,150,90,30,"Radio Button",$0000$)

REM create a bbj vector
LET myVector!=myAPI!.makeVector()

REM add the buttons to the vector
myVector!.addItem(myRadioButton1!)
myVector!.addItem(myRadioButton2!)
myVector!.addItem(myRadioButton3!)

REM add the grouping
myWindow!.addRadioGroup(myVector!)

REM Register the CALLBACK routines
CALLBACK(ON_CHECK_ON,RADIO_BUTTON_CHECKED,mySysGui!.getContext(),myRadioButton1!.getID())
CALLBACK(ON_CHECK_ON,RADIO_BUTTON_CHECKED,mySysGui!.getContext(),myRadioButton2!.getID())
CALLBACK(ON_CHECK_ON,RADIO_BUTTON_CHECKED,mySysGui!.getContext(),myRadioButton3!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the radio button is checked
RADIO_BUTTON_CHECKED:
REM Display a message that the radio button is checked
MESSAGE$="The radio button is checked"
LET X=MSGBOX(MESSAGE$)
RETURN

REM Callback routine called when the radio button is unchecked
RADIO_BUTTON_UNCHECKED:
REM Display a message that the radio button is unchecked
MESSAGE$="The radio button is unchecked"
LET X=MSGBOX(MESSAGE$)
RETURN

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN

See Also

BBjAPI

BBjVector

BBjSysGui

BBjControl

BBjWindow

RADIOGROUP Mnemonic - Create a Radio Button Group

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