BBjCheckOnEvent::isChecked

Description

In BBj 23.00 and higher, this method a boolean true value indicating that the control is checked.

Syntax

Return Value Method
boolean isChecked()

Parameters

None.

Return Value

Returns a true (1), indicating that the control is checked.

Remarks

This is a convenience method for use when the application registers the same callback for ON_CHECK_ON and ON_CHECK_OFF.

Example 1

rem ' BBjCheckBox
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,200,200,"BBjCheckBox",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
cb1! = window!.addCheckBox(101,25,25,150,25,"CheckBox1",$0000$)
cb1!.setCallback(cb1!.ON_CHECK_ON,"event")
cb1!.setCallback(cb1!.ON_CHECK_OFF,"event")
cb1!.setCallback(cb1!.ON_CHECK_CHANGE,"event",err=*next)
cb2! = window!.addCheckBox(102,25,50,150,25,"CheckBox2",$0000$)
cb2!.setCallback(cb2!.ON_CHECK_ON,"event")
cb2!.setCallback(cb2!.ON_CHECK_OFF,"event")
cb2!.setCallback(cb2!.ON_CHECK_CHANGE,"event",err=*next)
cb3! = window!.addCheckBox(201,25,100,150,25,"CheckBox3",$0020$)
cb3!.setCallback(cb3!.ON_CHECK_ON,"event")
cb3!.setCallback(cb3!.ON_CHECK_OFF,"event")
cb3!.setCallback(cb3!.ON_CHECK_CHANGE,"event",err=*next)
cb4! = window!.addCheckBox(202,25,125,150,25,"CheckBox4",$0024$)
cb4!.setCallback(cb4!.ON_CHECK_ON,"event")
cb4!.setCallback(cb4!.ON_CHECK_OFF,"event")
cb4!.setCallback(cb4!.ON_CHECK_CHANGE,"event",err=*next)
process_events
event:
event! = sysgui!.getLastEvent()
msg$ = event!.getCheckBox().getText()+" "+event!.getEventName()
msg$ = msg$ + " isChecked=" + Boolean.toString(event!.isChecked(),err=*next)
print msg$
System.err.println(msg$)
return
eoj:
release

Example 2

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")
rb1!.setCallback(rb1!.ON_CHECK_CHANGE,"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")
rb2!.setCallback(rb2!.ON_CHECK_CHANGE,"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")
rb3!.setCallback(rb3!.ON_CHECK_CHANGE,"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")
rb4!.setCallback(rb4!.ON_CHECK_CHANGE,"event")
rg1! = window!.addRadioGroup()
rg1!.setName("RadioGroup1")
print "rg1!.getName()=",rg1!.getName()
rg1!.add(rb1!)
rg1!.add(rb2!)
rg1!.add(rb3!)
rg1!.add(rb4!)
rg1!.setCallback(rg1!.ON_SELECTION_CHANGE,"group")
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")
rb5!.setCallback(rb5!.ON_CHECK_CHANGE,"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")
rb6!.setCallback(rb6!.ON_CHECK_CHANGE,"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")
rb7!.setCallback(rb7!.ON_CHECK_CHANGE,"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")
rb8!.setCallback(rb8!.ON_CHECK_CHANGE,"event")
rg2! = window!.addRadioGroup()
rg2!.setName("RadioGroup2")
print "rg2!.getName()=",rg2!.getName()
rg2!.add(rb5!)
rg2!.add(rb6!)
rg2!.add(rb7!)
rg2!.add(rb8!)
rg2!.setCallback(rg2!.ON_SELECTION_CHANGE,"group")
rem ' Filter events
on! = window!.addCheckBox(109,400,25,300,25,"ON_CHECK_ON",$0004$)
off! = window!.addCheckBox(110,400,50,300,25,"ON_CHECK_OFF",$0004$)
change! = window!.addCheckBox(111,400,75,300,25,"ON_CHECK_CHANGE",$0000$)
selection! = window!.addCheckBox(112,400,100,300,25,"ON_SELECTION_CHANGE",$0000$)
reset! = window!.addButton(2,600,25,150,25,"Reset",$$)
reset!.setCallback(reset!.ON_BUTTON_PUSH,"reset")
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()
  event$ = event!.getEventName()
  switch event$
    case "BBjCheckOnEvent"
      event = on!.isSelected(); break
    case "BBjCheckOffEvent"
      event = off!.isSelected(); break
    case "BBjCheckChangeEvent"
      event = change!.isSelected(); break
    case "BBjSelectionChangeEvent"
      event = selection!.isSelected(); break
    case default
      event = 1
  swend
  if !event then return
  msg$ = event$ + " " + event!.getRadioButton().getText()
  msg$ = msg$ + " " + event!.getRadioButton().getRadioGroup().getName(err=*next)
  msg$ = msg$ + " checked=" + Boolean.toString(event!.isChecked(err=*next))
  print msg$
  events!.addParagraph(-1,msg$)
  events!.highlight(-1,0,-1,0)
return
group:
  if !selection!.isSelected() then return
  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
reset:
  events!.setText("")
return

ClosedVersion History

  • BBj 23.00: BBjCheckOnEvent::isChecked added.

See Also

BBjAPI

BBj Object Syntax

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