BBjControl::isGrouped

Description

In BBj 19.00 and higher, this method returns whether the BBjControl is part of a keyboard navigation group, along with other BBjControls with contiguous control IDs.

Syntax

Return Value Method
boolean isGrouped()

Parameters

None.

Return Value

Returns true (1) if the control is grouped.

Returns false (0) if the control is not grouped.

Remarks

The default value of this setting is defined by the control creation flag $0020$.

Example

rem ' BBjControl::isGrouped

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
flags$ = $0000$
winflags$ = $00080003$
mask$ = "-###,##0.00"
keyboard = msgbox("Keyboard navigation?",4+32) = 6
if keyboard then winflags$ = ior(winflags$,$00010000$)
enterAsTab = msgbox("Enter as tab?",4+32+256) = 6
if enterAsTab then winflags$ = ior(winflags$,$00800000$)
grouped =  msgbox("Set group flag?",4+32) = 6
if grouped then flags$ = $0020$
window! = sysgui!.addWindow(25,25,800,550,"setGrouped",winflags$,$02800004$)
window!.setCallback(window!.ON_CLOSE,"eoj")

rem ' window/control options
enterAsTab$ = ior(flags$,iff(enterAsTab,$0000$,$0004$))
enterAsTab! = window!.addCheckBox(101,25,25,100,25,"Enter as Tab",enterAsTab$)
enterAsTab!.setTabTraversable(0)
enterAsTab!.setCallback(enterAsTab!.ON_CHECK_ON,"enterAsTabOn")
enterAsTab!.setCallback(enterAsTab!.ON_CHECK_OFF,"enterAsTabOff")
grouped$ = iff(grouped,$0004$,$0000$)
grouped! = window!.addCheckBox(102,150,25,100,25,"Grouped",grouped$)
grouped!.setTabTraversable(0)
grouped!.setCallback(grouped!.ON_CHECK_ON,"groupedOn")
grouped!.setCallback(grouped!.ON_CHECK_OFF,"groupedOff")

rem ' radio buttons in a radiogroup
radiogroup! = new BBjVector()
radiogroup!.add(window!.addRadioButton(201,25,75,100,25,"radiobutton1",flags$))
radiogroup!.add(window!.addRadioButton(202,150,75,100,25,"radiobutton2",flags$))
radiogroup!.add(window!.addRadioButton(203,275,75,100,25,"radiobutton3",flags$))
window!.addRadioGroup(radiogroup!)

rem ' standalone radio buttons
window!.addRadioButton(301,400,75,100,25,"radiobutton4",flags$)
window!.addRadioButton(302,525,75,100,25,"radiobutton5",flags$)
window!.addRadioButton(303,650,75,100,25,"radiobutton6",flags$)

rem ' checkboxes
window!.addCheckBox(401,25,125,100,25,"checkbox1",flags$)
window!.addCheckBox(402,150,125,100,25,"checkbox2",flags$)
window!.addCheckBox(403,275,125,100,25,"checkbox3",flags$)

rem ' buttons
window!.addButton(501,400,125,100,25,"button1",flags$)
window!.addButton(502,525,125,100,25,"button2",flags$)
window!.addButton(503,650,125,100,25,"button3",flags$)

rem ' menubuttons
print stbl("!COMPAT","MENUBUTTON_FOCUSABLE = TRUE")
print stbl("!COMPAT","MENUBUTTON_TAB_TRAVERSABLE = TRUE")
temp$ = ior(flags$,$4000$); rem ' border
window!.addMenuButton(601,25,175,100,25,"menubutton1",temp$)
window!.addMenuButton(602,150,175,100,25,"menubutton2",temp$)
window!.addMenuButton(603,275,175,100,25,"menubutton3",temp$)

rem ' toolbuttons
print stbl("!COMPAT","TBUTTON_FOCUSABLE = TRUE")
print stbl("!COMPAT","TBUTTON_TAB_TRAVERSABLE = TRUE")
window!.addToolButton(701,400,175,100,25,"toolbutton1",flags$)
window!.addToolButton(702,525,175,100,25,"toolbutton2",flags$)
window!.addToolButton(703,650,175,100,25,"toolbutton3",flags$)

rem ' edit
window!.addEditBox(801,25,225,100,25,"edit1",flags$)
window!.addEditBox(802,150,225,100,25,"edit2",flags$)
window!.addEditBox(803,275,225,100,25,"edit3",flags$)

rem ' edit spinner
window!.addEditBoxSpinner(901,400,225,100,25,"editspinner1",flags$)
window!.addEditBoxSpinner(902,525,225,100,25,"editspinner2",flags$)
window!.addEditBoxSpinner(903,650,225,100,25,"editspinner3",flags$)

rem ' inputd
window!.addInputD(1001,25,275,100,25,flags$).setToolTipText("inputd1")
window!.addInputD(1002,150,275,100,25,flags$).setToolTipText("inputd2")
window!.addInputD(1003,275,275,100,25,flags$).setToolTipText("inputd3")

rem ' inputd spinner
window!.addInputDSpinner(1101,400,275,100,25,flags$).setToolTipText("inputdspinner1")
window!.addInputDSpinner(1102,525,275,100,25,flags$).setToolTipText("inputdspinner2")
window!.addInputDSpinner(1103,650,275,100,25,flags$).setToolTipText("inputdspinner3")

rem ' inpute
window!.addInputE(1201,25,325,100,25,flags$,255,"","inpute1")
window!.addInputE(1202,150,325,100,25,flags$,255,"","inpute2")
window!.addInputE(1203,275,325,100,25,flags$,255,"","inpute3")

rem ' inpute spinner
window!.addInputESpinner(1301,400,325,100,25,flags$,255,"","inputespinner1")
window!.addInputESpinner(1302,525,325,100,25,flags$,255,"","inputespinner2")
window!.addInputESpinner(1303,650,325,100,25,flags$,255,"","inputespinner3")

rem ' inputn
window!.addInputN(1401,25,375,100,25,flags$).setToolTipText("inputn1")
window!.addInputN(1402,150,375,100,25,flags$).setToolTipText("inputn2")
window!.addInputN(1403,275,375,100,25,flags$).setToolTipText("inputn3")

rem ' inputn spinner
window!.addInputNSpinner(1501,400,375,100,25,flags$).setToolTipText("inputnspinner1")
window!.addInputNSpinner(1502,525,375,100,25,flags$).setToolTipText("inputnspinner2")
window!.addInputNSpinner(1503,650,375,100,25,flags$).setToolTipText("inputnspinner3")

rem ' listbutton
window!.addListButton(1601,25,425,100,250,"listbutton1",flags$).setToolTipText("listbutton1")
window!.addListButton(1602,150,425,100,250,"listbutton2",flags$).setToolTipText("listbutton2")
window!.addListButton(1603,275,425,100,250,"listbutton3",flags$).setToolTipText("listbutton3")

rem ' listedit
window!.addListEdit(1701,400,425,100,250,"listedit1",flags$).setToolTipText("listedit1")
window!.addListEdit(1702,525,425,100,250,"listedit2",flags$).setToolTipText("listedit2")
window!.addListEdit(1703,650,425,100,250,"listedit3",flags$).setToolTipText("listedit3")

rem ' listbox
window!.addListBox(1801,25,475,100,50,"listbox1",flags$).setToolTipText("listbox1")
window!.addListBox(1802,150,475,100,50,"listbox2",flags$).setToolTipText("listbox2")
window!.addListBox(1803,275,475,100,50,"listbox3",flags$).setToolTipText("listbox3")

rem ' cedit
temp$ = ior(flags$,$8004$)
window!.addCEdit(1901,400,475,100,50,"cedit1",temp$)
window!.addCEdit(1902,525,475,100,50,"cedit2",temp$)
window!.addCEdit(1903,650,475,100,50,"cedit3",temp$)
vector! = window!.getAllControls()
for i = 0 to vector!.size() - 1
    control! = vector!.get(i)
    control!.setCallback(control!.ON_GAINED_FOCUS,"event")
    control!.setCallback(control!.ON_LOST_FOCUS,"event")
next i
process_events

eoj:
release

enterAsTabOn:
    window!.setEnterAsTab(1)
return

enterAsTabOff:
    window!.setEnterAsTab(0)
return

groupedOn:
    vector! = window!.getAllControls()
    for i = 0 to vector!.size() - 1
        control! = vector!.get(i)
        if (control!.getID() > 200) then
            control!.setGrouped(1)
            print control!,control!.getID()," isGrouped ",Boolean.valueOf(control!.isGrouped())
        endif
    next i
return

groupedOff:
    vector! = window!.getAllControls()
    for i = 0 to vector!.size() - 1
        control! = vector!.get(i)
        if (control!.getID() > 200) then
            control!.setGrouped(0)
            print control!,control!.getID()," isGrouped ",Boolean.valueOf(control!.isGrouped())
        endif
    next i
return

event:
    event! = sysgui!.getLastEvent()
    control! = event!.getControl()
    print event!.getEventName()," ",control!.getToolTipText()," ",control!.getText()
return

See Also

BBjAPI

BBjSysGui

BBjWindow

Keyboard Focus, Keyboard Navigation, and the Default Button

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