Starter Window
P With the Pro Edition you can change
the engine's behavior before start and after finishing the application. By default,
a small startup window displays engine system messages
and then waits
two seconds before starting the application. However, with a WINDOW definition
in a .wdl file
you can skip the startup window, or create your own window
with buttons, pictures, greeting messages, your company's logo, or a
progress bar.
WINDOW WINSTART { ... }
Defines the start window which appears at
startup.
If a start window is user defined, the application will start immediately after
displaying the engine messages (without the two seconds waiting). The window must contain at least the MODE definition (see below).
WINDOW WINEND { ... }
Defines the end window which appears after
exiting the application. The WINEND window is closed by pressing
a key or by a mouse click. The window must contain at least the MODE definition (see below).
If the WINEND window is not defined, the
engine will exit without displaying an end window.
Within the winged brackets of the start or end window definition,
the following parameters can be given:
TITLE "text";
Text that appears in the title bar of the window.
SIZE x, y;
Window size in pixels.
BG_COLOR RGB(r, g, b);
Window background color; r, g, b = red, green, blue component in the
range of 0..255.
BG_PATTERN <filename>, OPAQUE;
Window background pattern, given by the image file name brackets (.PCX
or .BMP file, 8-bit 256 colors only).
BUTTON BUTTON_START, SYS_DEFAULT, "text", x, y,
width, height;
Places a start button with the given text at the given position.
The application will only start when the button is pressed.
BUTTON BUTTON_QUIT, SYS_DEFAULT, "text", x, y,
width, height;
Places an exit button with the given text at the given position.
FRAME style, x, y, width, height;
A frame within the window. Style can be FTYP1, FTYP2,
FTYP3, or FTYP4; x, y is the position of the upper left edge,
width, height the size of the frame.
MODE style;
The window mode
(always required within the WINDOW definition)
. Style can be either STANDARD, IMAGE, FULLSCREEN, or USE_OLDSTYLE.
PATTERN <filename>, OPAQUE,
x, y, width, height;
Fills the given area with the background pattern given by the image file
name.
x, y is the position of the upper left edge, width, height the
size of the area.
PICTURE <filename>, OPAQUE,
x, y;
Places a picture from the image file at the given xy position.
PROGRESS RGB(r, g, b), elements,
x, y, width, height;
Displays a progress bar. r, g, b = red, green, blue component
in the range of 0..255;
elements is the number of dots
displayed in the engine standard output;
x, y is the position of the upper left edge, width, height the
size of the bar.
SET FONT "font", RGB(r,
g, b);
Gives a font and color for the following TEXT. "font"
is a windows font, like
"Arial" (without attributes like '#bi').
If it is not available, or if "" is given,
the standard font is used.
r, g, b is the color in red, green, blue components in the range
of 0..255.
TEXT "text", x, y;
Prints the given text at the x, y position of the window.
The text must be completely inside the window.
TEXT_STDOUT "font", RGB(r,
g, b), x, y, width, height;
Gives the font, color, and size of the scrollable text field for the
engine messages.
COMMAND "text";
Additional command line options passed to the
engine. The given text is added to the original command line.
For instance, in order to start without any startup window, use:
WINDOW WINSTART
{
MODE STANDARD; // always required
COMMAND "-nwnd"; // no start window
}
Remarks:
-
WINDOW definitions must be contained in a .wdl project file with the same name as the script file (f.i. "main.wdl" when the script name is "main.c").
- The window definition will only become valid
after publishing the WDL file. WDL files can be published with SED just like scripts.
Starter must be checked in the Publish dialog. This will generate a Windows Definition File (acknex.wdf) that is then interpreted by the engine at startup before the script is read. The .wdf file contains all keywords and images needed for the start and exit windows. Creating an acknex.wdf file from the WED command line is also possible, e.g. "C:\program files\Gstudio7\WED -c name.wdl" (when name.wdl is the .wdl file with the WINDOW definition in the current folder). When the publish dialog pops up, check Starter only, then click [Ok]. The .wdf file will be created in the work folder.
- Within a WINDOW definition, all images must be in PCX or BMP 8-bit, 256 color format
(indexed colors,
with palette). Image file names
must be given in angular brackets <..> as shown in the examples. Font names must not contain spaces. Fonts must be available on
the target systems.
-
Syntax or file format errors are indicated by error numbers during
creation of the starter file
("ERRNO #...").
In that case, check the syntax and the format of the used image files.
Edition:
P
Example
(scriptname.wdl):
WINDOW WINSTART
{
TITLE "My Simulator";
SIZE 480,320;
MODE IMAGE;
BG_COLOR RGB(240,240,240);
FRAME FTYP1,0,0,480,320;
BUTTON BUTTON_START,SYS_DEFAULT,"Start",400,288,72,24;
BUTTON BUTTON_QUIT,SYS_DEFAULT,"Abort",400,288,72,24;
SET FONT "Arial", RGB(255,255,255);
TEXT "Get ready...", 0,0;
TEXT_STDOUT "Arial",RGB(0,0,0),10,10,460,280;
BG_PATTERN <background.pcx>,OPAQUE;
PATTERN <checker.pcx>,OPAQUE,50,50,100,100;
PICTURE <splash.pcx>,OPAQUE,10,10;
PROGRESS RGB(0,0,255), 10, 0, 300, 400, 20;
COMMAND "-diag";
}
WINDOW WINEND
{
TITLE "Finished";
SIZE 540,320;
MODE STANDARD;
BG_COLOR RGB(0,0,0);
TEXT_STDOUT "Arial",RGB(255,40,40),10,20,520,270;
SET FONT "Arial",RGB(0,255,255);
TEXT "Any key to exit",10,270;
}
See also:
sys_exit, command
line options
► latest
version online