Interface Focusable::setFocusable

 


Description

In BBj 6.0 and higher, setFocusable sets whether a control can be focused.

Note: A focused control is the control to which keyboard interaction is directed. Typically, the focused control is indicated visually, often via a dotted grey border. A control which is not focusable, therefore, cannot be manipulated via the keyboard. It is still possible to interract with a non-focusable control via the mouse. To disable all interaction, including the mouse, see setEnabled() and setEditable().

Syntax

Return Value

Method

void

setFocusable(boolean foc)

Parameters

Variable

Description

foc

0 – the control is not focusable

1 – the control is focusable

Return Value

None.

Example

LET myAPI!=BBjAPI()

SYSGUI=UNT
OPEN (SYSGUI) "X0"

LET mySysGui!=myAPI!.getSysGui()

myWindow! = mySysGui!.addWindow(10,10,100,300,"Mouse Focusable Demo",$00010003$)
both1! = myWindow!.addEditBox(101,10,10,90,30,"Both Tab and Mouse",$0008$)
both2! = myWindow!.addEditBox(102,10,50,90,30,"Both Tab and Mouse",$0008$)

justMouse! = myWindow!.addEditBox(104,10,150,90,30,"Just Mouse",$0008$)
justMouse!.setTabTraversable(0)

justMouse! = myWindow!.addEditBox(105,10,200,90,30,"Neither",$$)
justMouse!.setFocusable(0)

neither! =  myWindow!.addButton(106,10,250,90,30,"Neither",$0000$)
neither!.setFocusable(0)

CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

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

See Also

BBjAPI

BBjSysGui

BBjControl

Focusable

TabTraversable

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.