BBjSysGui::addWindow
Description
Creates a top level GUI window in the current or specified context, depending on the syntax used.
Syntax
Return Value | Method |
---|---|
BBjTopLevelWindow | addWindow(number x, number y, number w, number h, string title) |
BBjTopLevelWindow | addWindow(number x, number y, number w, number h, string title, byte[] flags) |
BBjTopLevelWindow | addWindow(number x, number y, number w, number h, string title, byte[] flags, byte[] event_mask) |
BBjTopLevelWindow | addWindow(int context, number x, number y, number w, number h, string title) |
BBjTopLevelWindow | addWindow(int context, number x, number y, number w, number h, string title, byte[] flags) |
BBjTopLevelWindow | addWindow(int context, number x, number y, number w, number h, string title, byte[] flags, byte[] event_mask) |
BBjTopLevelWindow | addWindow(string title) |
BBjTopLevelWindow | addWindow(string title, byte[] flags) |
BBjTopLevelWindow | addWindow(string title, byte[] flags, byte[] event_mask) |
BBjTopLevelWindow | addWindow(int context, string title) |
BBjTopLevelWindow | addWindow(int context, string title, byte[] flags) |
BBjTopLevelWindow | addWindow(int context, byte[] flags, byte[] event_mask) |
Parameters
Variable |
Description |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
context | Specifies a new SYSGUI device context in which to create the window. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
x | Horizontal position of the upper-left corner of the window in current units. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
y | Vertical position of the upper-left corner of the window in current units. This value does not take into account the space taken by menus or title bars. If a window is defined with a menu and a title bar and its y parameter is set to zero, the menu and title bar will not be visible when a BBj program displays the window. The y parameter should be adjusted by about 20 pixels to account for a menu and about 20 pixels for a title bar. For example, if a window has a menu and a title bar and the y parameter is set to 60, the top of the title bar will appear about 20 pixels from the top of the screen when a BBj program displays the window. See the Remarks section below. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
w | Width of the window in current units. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h | Height of the window in current units. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
title | The title of the new window. This is the initial title and can be changed at any time with the 'TITLE' mnemonic. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
flags |
Window flags, as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_mask |
Event masks to be applied to the window:
|
Return Value
All versions of the addWindow method return a BBjTopLevelWindow object.
Remarks
In BBj 15.00 and higher, the LEGACY_WINDOW_POSITION !COMPAT setting can be set to TRUE to position windows according to the documented Visual PRO/5 rules ("The x,y,w,h bounding rectangle of a window describes the location of the inside (the usable drawing area or client area) of the window. Note that if a window is placed at (0,0), the title bar will not be visible."). By default, BBj positions windows according to the rules defined by Java and the host operating system. This might differ from Visual PRO/5 by 20-30 pixels vertically and several pixels horizontally.
If the x, y, width, and height parameters are not specified, they are all initialized to 0. This is typically for use with DWC windows that dynamically arrange their contents (window creation flag $00100000$).
Example 1
|
Example 2: DWC Dynamic Flow Layout (BBj 22.01 and higher)
|
See Also
WINDOW Mnemonic - Create a SYSGUI Window
EVENTMASK Mnemonic - Change Event Mask
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.