
BBjWindow::addChildWindow
Description
Adds a child window in the BBjWindow.
Syntax
Return Value |
Method |
---|---|
addChildWindow(int ID, int x, int y, int w, int h, int context) |
|
addChildWindow(int ID, int x, int y, int w, int h, string title, int context) |
|
addChildWindow(int ID, int x, int y, int w, int h, string title, string flags, int context) |
|
addChildWindow(int ID, int x, int y, int w, int h, string title, string flags, int context, string eventMask) |
|
BBjChildWindow | addChildWindow(int ID, int context) |
BBjChildWindow | addChildWindow(int ID, string title, int context) |
BBjChildWindow | addChildWindow(int ID, string title, string flags, int context) |
BBjChildWindow | addChildWindow(int ID, string title, string flags, int context, string eventMask) |
BBjChildWindow | addChildWindow(int context) |
BBjChildWindow | addChildWindow(string title, int context) |
BBjChildWindow | addChildWindow(string title, string flags, int context) |
BBjChildWindow | addChildWindow(string title, string flags, int context, string eventMask) |
BBjChildWindow | addChildWindow(int ID, int context) |
BBjChildWindow | addChildWindow(int ID, string title, int context) |
BBjChildWindow | addChildWindow(int ID, string title, string flags, int context) |
BBjChildWindow | addChildWindow(int ID, string title, string flags, int context, string eventMask) |
BBjChildWindow | addChildWindow(int context) |
BBjChildWindow | addChildWindow(string title, int context) |
BBjChildWindow | addChildWindow(string title, string flags, int context) |
BBjChildWindow | addChildWindow(string title, string flags, int context, string eventMask) |
Parameters
Variable |
Description |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ID |
Control ID number. It must be an integer between 1 and 32767 and be unique within a given top-level window. |
||||||||||||||||||||||||||||||||||||
x |
Horizontal position of the upper-left corner of the child window. |
||||||||||||||||||||||||||||||||||||
y |
Vertical position of the upper-left corner of the child window. |
||||||||||||||||||||||||||||||||||||
w |
Width of the child window, in pixels. |
||||||||||||||||||||||||||||||||||||
h |
Height of the child window, in pixels. |
||||||||||||||||||||||||||||||||||||
title |
Title of the child window. |
||||||||||||||||||||||||||||||||||||
flags |
Control flags, as follows:
|
||||||||||||||||||||||||||||||||||||
context |
An empty context for the child window to occupy. The child can then be referenced either by its ID number from within the parent context or by the ID 0 from its own context. Either method can be used in most cases. |
||||||||||||||||||||||||||||||||||||
eventMask |
Event mask to be applied to the child window. For additional information, see SYSGUI Event Queue. |
Return Value
Returns the created BBjWindow object.
Remarks
If the ID parameter is not specified, a control ID is assigned dynamically using getAvailableControlID().
If the x, y, width, and height parameters are not specified, they're all initialized to 0. This is typically for use with DWC windows that dynamically arrange their contents (window creation flag $00100000$).
Example
REM Add a child window to 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 Set the current context
mySysGui!.setContext(0)
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 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 Process Events
PROCESS_EVENTS
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN
See Also
CHILD Mnemonic - Create a Child Window
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.