BBjWindow::getChildWindow

Description

Retrieves a BBjChildWindow object given a control ID. In BBj 14.0 and higher, this method supports reference to the BBjChildWindow by name.

Syntax

Return Value

Method

BBjChildWindow

getChildWindow(int ID)

BBjChildWindow

getChildWindow(string name)

Parameters

Variable

Description

ID

Specifies the Control ID of the child window.

name

Specifies the name of the child window.

Return Value

None.

Remarks

Returns the child window object if it exists. Returns null if the child window object does not exist.

Example

REM Get a child window from a top level window

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBJAPI()

REM Open the SysGui device
LET SYSGUI=UNT
OPEN (SYSGUI)"X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
LET X=10
LET Y=10
LET WIDTH=200
LET HEIGHT=200
LET TITLE$="BBj Window"

REM Create a top level window
LET myWindow!=mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

REM Create a child window
LET myChildWindow!=myWindow!.addChildWindow(200,50,50,100,100,"",$$,1,$$)

REM Get the context of the child window and set it to be the current context
LET CHILD_CONTEXT=mySysGui!.getContext()

REM Add a static text control on the child window
CHILD_TEXT$="Child Window"
LET myStaticText!=myChildWindow!.addStaticText(300,X,Y,WIDTH,HEIGHT,CHILD_TEXT$)

REM Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,0)

REM Get the child window
childWindow! = myWindow!.getChildWindow(200)

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

BBjWindow

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