BBjRadioButton

Description

The BBjRadioButton object provides methods for manipulating a GUI radio button control.

Implemented Interfaces

Editable, Focusable, TabTraversable, TextAlignable, Validateable

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjRadioButton

A BBjRadioButton object is created through the following BBjWindow methods:

Return Value

Method

BBjRadioButton

addRadioButton(int ID, number x, number y, number w, number h, string title)

BBjRadioButton

addRadioButton(int ID, number x,number y, number w, number h, string title, string flags)

BBjRadioButton

addRadioButton(int ID, String title)

BBjRadioButton

addRadioButton(int ID, String title, String flags)

BBjRadioButton

addRadioButton(String title)

BBjRadioButton

addRadioButton(String title, String flags)

Methods of BBjRadioButton

Return Value

Method

int

getHorizontalTextPosition()

BBjRadioGroup

getRadioGroup()

boolean

isEditable()

boolean

isSelected()

void

setEditable(boolean editable)

void

setHorizontalTextPosition(int position)

void

setSelected(boolean selected)

Methods of BBjRadioButton implemented for Editable

Return Value Method
boolean isEditable()
void setEditable(boolean edit)

Methods of BBjRadioButton implemented for Focusable

Return Value Method
boolean isFocusable()
void setFocusable(boolean focus)

Methods of BBjRadioButton implemented for TabTraversable

Return Value Method
boolean isTabTraversable()
void setTabTraversable(boolean trav)

Methods of BBjRadioButton implemented for TextAlignable

Return Value Method
int getAlignment()
void setAlignment(int align)

Methods of BBjRadioButton implemented for Validateable

Return Value Method
void accept(boolean valid)
string getValidationText()

Methods of BBjRadioButton inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_CHECK_CHANGE BBjCheckChangeEvent Check/Uncheck Event c

ON_CHECK_OFF

BBjCheckOffEvent

Check/Uncheck Event

c

ON_CHECK_ON

BBjCheckOnEvent

Check/Uncheck Event

c

ON_CONTROL_VALIDATION

BBjControlValidationEvent

Control Validation Event

v

ON_GAINED_FOCUS

BBjGainedFocusEvent

Control Focus Gained/Lost Event

f

ON_LOST_FOCUS

BBjLostFocusEvent

Control Focus Gained/Lost Event

f

ON_MOUSE_ENTER

BBjMouseEnterEvent

Mouse Enter/Exit Event

E

ON_MOUSE_EXIT

BBjMouseExitEvent

Mouse Enter/Exit Event

E

ON_POPUP_REQUEST

BBjPopupRequestEvent

Popup Request Event

r

ON_RIGHT_MOUSE_DOWN

BBjRightMouseDownEvent

Right Mouse Button Down Event

R

CSS

The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.

The BBjRadioButton is implemented as an <input type="radio"> element with an associated label. It defines the following style names:

.BBjRadioButton

.BBjRadioButton.bbj-checked

.BBjRadioButton.bbj-disabled

.BBjRadioButton.bbj-focused

.BBjRadioButton.bbj-readonly

HTML checkbox and radiobutton elements are notoriously difficult to style.

Remarks

By default, radiobuttons are not automatically selected when they gain focus programmatically or by user keyboard operation (TAB/SHIFT+TAB or LEFT,  RIGHT, UP, DOWN arrows within a keyboard navigation group). In BBj 16.00 and higher, setting the RADIOBUTTON_SELECT !COMPAT setting to TRUE causes radiobuttons to be selected when they gain focus for any reason.

Constants inherited from BBjControl

Example

rem ' BBjRadioButton

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,200,200,"BBjRadioButton",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
rb1! = window!.addRadioButton(101,25,25,150,25,"RadioButton1",$0020$)
rb1!.setCallback(rb1!.ON_CHECK_ON,"event")
rb1!.setCallback(rb1!.ON_CHECK_OFF,"event")
rb1!.setCallback(rb1!.ON_CHECK_CHANGE,"event",err=*next)
rb2! = window!.addRadioButton(102,25,50,150,25,"RadioButton2",$0020$)
rb2!.setCallback(rb2!.ON_CHECK_ON,"event")
rb2!.setCallback(rb2!.ON_CHECK_OFF,"event")
rb2!.setCallback(rb2!.ON_CHECK_CHANGE,"event",err=*next)
rg1! = bbjapi().makeVector()
rg1!.add(rb1!)
rg1!.add(rb2!)
window!.addRadioGroup(rg1!)
rb3! = window!.addRadioButton(201,25,100,150,25,"RadioButton3",$0020$)
rb3!.setCallback(rb3!.ON_CHECK_ON,"event")
rb3!.setCallback(rb3!.ON_CHECK_OFF,"event")
rb3!.setCallback(rb3!.ON_CHECK_CHANGE,"event",err=*next)
rb4! = window!.addRadioButton(202,25,125,150,25,"RadioButton4",$0020$)
rb4!.setCallback(rb4!.ON_CHECK_ON,"event")
rb4!.setCallback(rb4!.ON_CHECK_OFF,"event")
rb4!.setCallback(rb4!.ON_CHECK_CHANGE,"event",err=*next)
rg2! = bbjapi().makeVector()
rg2!.add(rb3!)
rg2!.add(rb4!)
window!.addRadioGroup(rg2!)
process_events

event:
    event! = sysgui!.getLastEvent()
    msg$ = event!.getRadioButton().getText()+" "+event!.getEventName()
    msg$ = msg$ + " isChecked=" + Boolean.toString(event!.isChecked(),err=*next)
    print msg$
    System.err.println(msg$)
return

eoj:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

RADIOBUTTON Mnemonic - Create a Radio Button Control

CALLBACK Verb - Register BBj Subroutine

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