BBjWindow::addChildWindow

Description

Adds a child window in the BBjWindow.

Syntax

Return Value

Method

BBjChildWindow

addChildWindow(int ID, int x, int y, int w, int h, int context)

BBjChildWindow

addChildWindow(int ID, int x, int y, int w, int h, string title, int context)

BBjChildWindow

addChildWindow(int ID, int x, int y, int w, int h, string title, string flags, int context)

BBjChildWindow

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:

Flag Description

$00000004$

Causes a horizontal scroll bar to appear whenever the window is resized to be smaller than its initial size and setTrack(0) is specified.

$00000008$

Causes a vertical scroll bar to appear whenever the window is resized to be smaller than its initial size and setTrack(0) is specified.

$00000010$

Sets the child window to be initially invisible.

$00000020$

Sets the child window to be initially disabled.

$00000800$

Creates a child window without a border.

$00001000$

In BBj 22 and higher, if creation flag $00008000$ is also specified, the simple child window is created as a fieldset element to emulate groupbox functionality. The default implementation uses a div element. This option is only meaningful in the DWC client.

$00008000$

In BBj 22 and higher, creates a simple child window that doesn't support a status bar or internal docked child windows. This option is only meaningful in the DWC client.

$00010000$   

Activates keyboard navigation in the child window. If this flag is specified, key pressed ("t") events for arrow keys and the tab key will not be reported.

$00100000$   

Automatically arranges all controls to fit within the child window. In the DWC client, this flag causes the window to use dynamic flow layout, ignoring all absolute control sizes and positions.

$00200000$   

Attaches the child window to one side of the parent frame, by default to the top frame. It will always occupy the full extent of the parent window's edge (even if the parent is resized later), but the other dimension is determined by the width or height specified when the child was created. By default, docked child windows are attached to the top of their parent. This can be changed with the 'DOCK' mnemonic.

$00800000$

Sets the Enter key to behave as a Tab key.

$01000000$

Draws a recessed client edge around the child window.

$02000000$

Draws a raised edge around the child window.

$08000000$

In BBj 8.0 and higher, causes the window to enforce unique control names. See BBjWindow::getControl.

$10000000$

In BBj 15.0 and higher, causes the window to report all mouse events for all controls.

$20000000$

In BBj 15.0 and higher, causes the window to report all keypress events for all controls.

$80000000$

In BBj 17.0 and higher, creates the window with 'TRACK'(0) instead of the default 'TRACK'(1).

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

Copy
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

BBjAPI

BBjSysGui

BBjControl

BBjWindow

CHILD Mnemonic - Create a Child Window

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