[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| DEFINE WINDOW |
+---------------------------------+
DEFINE WINDOW <window name1>
FROM <row1>, <col1>
TO <row2>, <col2>
[IN [WINDOW] <window name2>
| IN SCREEN]
[FOOTER <expC1>]
[TITLE <expC2>]
[DOUBLE | PANEL | NONE
| SYSTEM | <border string>]
[CLOSE | NOCLOSE]
[FLOAT | NOFLOAT]
[GROW | NOGROW]
[MINIMIZE]
[SHADOW]
[ZOOM | NOZOOM]
[FILL <expC3>]
[COLOR SCHEME <expN>
| COLOR <color pair list>]
-----------------------------------
Creates a window.
-----------------------------------
The DEFINE WINDOW command creates a user window and specifies its
attributes. After windows have been defined they may be displayed on
the screen using the ACTIVATE WINDOW or SHOW WINDOW commands. The
number of windows you can DEFINE is limited only by the amount memory
you have available.
Window definitions are placed in memory and their names are listed in
the bottom portion of the Window menu popup. The first window to be
defined appears at the top of the list, followed by each successively
defined window. The window that output is currently directed to is
marked with a diamond. If there isn't an output window, output goes to
the screen. Activated windows remain on the screen until a DEACTIVATE
WINDOW or HIDE WINDOW command is used to remove them from the screen.
These two commands remove windows from the screen but not from memory.
Windows may be placed back on the screen again with the ACTIVATE WINDOW
or SHOW WINDOW commands.
To remove windows from both the screen and memory, use the CLEAR WINDOWS
or RELEASE WINDOWS commands. Windows that are removed from memory must
be defined again to place them back on the screen.
Clauses
-------
<window name1>
Name of window to be created. Window names may be up to 10 characters
long. They must begin with a letter or underscore and may contain any
combination of letters, numbers and underscores. See WTITLE() in this
help facility for a discussion of window names and titles.
FROM <row1>, <col1> TO <row2>, <col2>
Position on screen of upper left corner of window and lower right
corner. A window may be defined with coordinates that lie outside of
the screen border, and the window may be larger than the screen.
Windows may also be placed inside of other windows.
IN [WINDOW] <window name2>
Integrates child window with parent window it is defined in. For
example, a child window defined and activated inside a parent window may
not be moved outside the parent window, nor may it be sized larger than
the parent window. If the parent window is moved, the child window
moves with it.
When a child window is defined within a parent window, the coordinates
specified in the DEFINE WINDOW command are relative to the parent
window, not the screen.
IN SCREEN
Defines window on screen instead of inside window.
FOOTER
Assigns a footer centered in bottom border of window. If the footer is
wider than the window, the footer is truncated.
TITLE <expC2>
Assigns title. The title is centered in the top border of the window.
If the title is wider than the window, the title is truncated.
DOUBLE | PANEL | NONE | SYSTEM | <border string>
Defines window border. If you include the SYSTEM option, you may
emulate the look of system windows. If the CLOSE, GROW or ZOOM options
are included with the SYSTEM option in a window definition, the
corresponding window control (close box, size control, zoom control)
will appear in the window border. If the SYSTEM option is included you
may not specify a different border style (DOUBLE, NONE, custom border
string, etc.).
You may define your own custom border with the <border string> option.
For more information on defining a custom border, see the SET BORDER
command for the syntax for a border string.
CLOSE | NOCLOSE
Allows or prevents window from being closed.
FLOAT | NOFLOAT
Allows or prevents window from being moved.
GROW | NOGROW
Allows or prevents window size from changing.
MINIMIZE
Allows or prevents window from being reduced to minimum size. A window
may be minimized and "docked" in the lower right corner of the screen by
pressing the Shift key when you double click the mouse on the top border
of the window.
SHADOW
Defines window with darkened area behind it.
ZOOM | NOZOOM
Prevents or allows a window to be enlarged.
FILL <expC3>
Fills background of window with character of your choice.
COLOR SCHEME <expN>
| COLOR <color pair list>
Overrides default color settings. By default, user windows take their
colors from scheme 1.
+---------------------------------+
| Program Examples |
+---------------------------------+
In this example, window named OUTPUT is DEFINED and ACTIVATED. Program
waits for you to press a key and window is hidden. Program waits for
you to press a key again and window is shown. Example below
demonstrates how a fancy window can be created with FOOTER and TITLE
options. Colors in this program are set for default FoxPro colors.
CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
ACTIVATE WINDOW output
WAIT
HIDE WINDOW output
WAIT
SHOW WINDOW output
*** Fancy Window Program Example ***
SET TALK OFF
STORE CHR(187) TO a
STORE CHR(201) TO b
STORE CHR(205) TO c
STORE CHR(188) TO d
STORE CHR(200) TO e
DEFINE WINDOW w1 FROM 2,2 TO 16,35 DOUBLE FLOAT CLOSE MINIMIZE ;
TITLE A + REPLICATE(B + C + C + A, 5) + B ;
FOOTER D + REPLICATE(E + C + C + D, 5) + E ;
COLOR , , W+/B,W+/B,W+/B
DEFINE WINDOW w2 IN W1 FROM 0,1 TO 12,30 DOUBLE ;
TITLE C + D + REPLICATE(E + A + B + D, 5) + E + C ;
FOOTER A + REPLICATE(B + D + E + A, 5) + B ;
COLOR , , W+/B,W+/B,W+/B
DEFINE WINDOW w3 IN W2 FROM 0,1 TO 10,26 DOUBLE ;
TITLE C + D + REPLICATE(E + C + C + D, 4) + E + C ;
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson