BBjSysGui::getActiveContext

Description

In BBj 2.01 and higher, this method returns the context ID of the current active or focused window.

Syntax

Return Value

Method

int

getActiveContext()

Parameters

None.

Return Value

Returns the context ID of the current active window or -1 if there are no active windows.

Remarks

None.

Example

rem 'Get the active context of the SysGui device

rem 'Obtain the instance of the SysGui object
open(1)"X0"
sg! = BBJAPI().getSysGui()

rem 'No windows, so should print -1
print sg!.getActiveContext()
sg!.setContext(1)
win1! = sg!.addWindow(100,100,300,300,"Win1",$02$)
sg!.setContext(2)
win2! = sg!.addWindow(200,200,300,300,"Win2",$80002$)
sg!.setContext(3)
win3! = sg!.addWindow(300,300,300,300,"Win3",$02$)

rem 'Should print 2 (the modal window)
print sg!.getActiveContext()
callback(ON_CLOSE,CLOSEWIN,2)
process_events

CLOSEWIN:
    print(1)'context'(2)
    print(1)'destroy'(0)

    rem 'Should print 3
    print sg!.getActiveContext()
return

See Also

BBjAPI

BBjWindow

NULL() Function

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