| Discussion:
|
This mnemonic creates and selects an extended window, using the following parameters:
| Parameter |
Description |
| column |
The column location of the upper, left-hand corner of the window. This numeric value is expressed
in QCRT characters or screen pixels, depending on the value of the flags (see below). |
| row |
The row location of the upper, left-hand corner of the window. This numeric value is expressed
in QCRT characters or screen pixels, depending on the value of the flags (see below). |
| width |
The width of the window. This numeric value is expressed in QCRT characters. |
| height |
The height of the window. This numeric value is expressed in QCRT characters. |
| style |
The style of Window. This numeric value is the sum of the following options:
| Value |
Meaning |
| 1 |
A popup window. The window can be moved outside of Comet window.
This value should not be used with 2 (which specifies a child window).
|
| 2 |
A child window. The window remains within the view window.
This value should not be used with 1 (which specifies a popup window). |
| 4 |
The window includes a caption bar. |
| 8 |
The window includes a border. |
| 16 |
The caption bar includes an "X" which closes the window.
Note: Clicking on the "X" causes an (EasyScan)
event to be reported to the Internet Basic program. The EasyScan value is 15. |
| 32 |
The window includes a thick frame that lets the user resize the window. |
| 64 |
The window is visible. |
|
| flags |
The flags for the window. This numeric value is the sum of the following options:
| Value |
Meaning |
| 0 |
A modeless window (also known as a user-selectable window).
Note: If multiple Comet windows are displayed, the user can select
which window is the active one by clicking the caption bar.
The Internet Basic program can determine the handle of the the window from which
data was transmitted via the STS function. |
| 1 |
A modal window. All other Comet windows are disabled until
this window closes. |
| 2 |
A child window with no frame (border). This flag can be
used to simulate a legacy Comet window
(see CreateWindow). |
| 4 |
The window includes a message line (also known as a control line).
Any text written with the (WC) mnemonic
will be displayed on the message line within this window. |
The following flags pertain to non-child windows only:
| Value |
Meaning |
| 8 |
The column and row positions are expressed in screen pixels, and are
relative to the screen (i.e., 0,0 = the upper, left-hand pixel
of the screen). |
| 16 |
The column and row positions are expressed in screen pixels, and are
relative to the client window (i.e., 0,0 = the upper, left-hand pixel
of the client window). |
| 32 |
The column and row positions are expressed in screen pixels, and are
relative to the frame window (i.e., 0,0 = the upper, left-hand pixel
of the frame window). |
|
| caption$ |
If the caption bar style is in effect, this string value is
displayed on the caption bar. |
Each extended window is identified by a 4-byte string known as a window handle.
The handle value is assigned by the system and returned to the Internet Basic program
via an INPUT statement following the (CreateWindowEx) mnemonic, as follows:
Length 4 & Local Handle1$
.
.
.
Print (CreateWindowEx=0,0,35,15,68,1,"This is the caption")
Input Handle1$
It follows that the Internet Basic program can create multiple extended windows. The program
can select which window to use via the (SelectWindowEx) mnemonic.
An extended window is deleted via the (DeleteWindowEx) mnemonic.
|
| Note:
|
If you write a program that displays more than one extended window at a time, your
program may need some way to distinguish which window was active at the
time that data was input.
The STS function returns the handle of the window that
generated the input. This 4-byte value starts in position 11, as shown here:
Length 4 & Local Handle$
.
Handle$ = SUB(STS(0),11,4)
|
| Symbolic constants:
|
Symbolic constants can be very useful when dealing with the multiple style and flag values.
For example, here is a list of recommended symbolic constants for extended windows:
! Window style
SET COS.WS.POPUP = 1 ! Can be moved outside of Comet window. Should
! not be used with COS.WS.CHILD.
SET COS.WS.CHILD = 2 ! Remains within view window. Should not be used
! with COS.WS.POPUP.
SET COS.WS.CAPTION = 4 ! Includes a caption bar
SET COS.WS.BORDER = 8 ! Window includes a border
SET COS.WS.SYSMENU = 16 ! Caption bar 'X' closes window
SET COS.WS.THICKFRAME = 32 ! Thick frame for sizing
SET COS.WS.VISIBLE = 64 ! Window is visible
SET COS.WS.POPUPWINDOW = 25 ! (COS.WS.POPUP+COS.WS.BORDER+COS.WS.SYSMENU)
! Window flags
SET COS.WF.MODELESS = 0 ! - User selectable window - Use EasyScan
! to determine when a window is activated.
SET COS.WF.MODAL = 1 ! - All other windows are disabled until
! this window closes
SET COS.WF.NOFRAME = 2 ! Create CHILD window with no frame (border).
! Used to simulate a Comet window
SET COS.WF.MSGLINE = 4 ! Has a message line
! The following flags pertain to non-child windows only
SET COS.WF.SCNPIXELPOS = 8 ! Position is in pixels, screen relative
SET COS.WF.CLIPIXELPOS = 16 ! Position is in pixels, client window relative
SET COS.WF.FRMPIXELPOS = 32 ! Position is in pixels, frame window relative
|
With these symbolic constants in place, you can specify the style and flag values by
writing a symbolic "formula," as follows:
Length 3.0 & Local Style, Flags
Length 5 & Local Handle1$
.
.
.
Style = COS.WS.POPUPWINDOW + COS.WS.CAPTION
Flags = COS.WF.MODAL + COS.WF.MSGLINE + COS.WF.CLIPIXELPOS
Print (CreateWindowEx=0,0,35,15,Style,Flags,"This is the caption")
Input Handle1$
|