home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
turbopas
/
wndw55.arc
/
WNDWREF.DOC
< prev
next >
Wrap
Text File
|
1989-08-24
|
103KB
|
2,117 lines
MULTI-LEVEL VIRTUAL WINDOWS
REFERENCE GUIDE
Version 5.5
August 24, 1989
Copyright (C) 1988-1989 Eagle Performance Software
All Rights Reserved.
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
T A B L E O F C O N T E N T S
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . 4
Purpose . . . . . . . . . . . . . . . . . . . . . . . 4
Common Parameters . . . . . . . . . . . . . . . . . . 4
Attributes . . . . . . . . . . . . . . . . . . . . . 5
2. PROCEDURES AND FUNCTIONS . . . . . . . . . . . . . . . 6
AccessWindow . . . . . . . . . . . . . . . . . . . . 6
ChangeBorder . . . . . . . . . . . . . . . . . . . . 6
GetLevelIndex . . . . . . . . . . . . . . . . . . . . 6
HeapOK . . . . . . . . . . . . . . . . . . . . . . . 7
HideWindow . . . . . . . . . . . . . . . . . . . . . 7
InitWindow . . . . . . . . . . . . . . . . . . . . . 7
LocateCursor . . . . . . . . . . . . . . . . . . . . 7
MakeWindow . . . . . . . . . . . . . . . . . . . . . 8
MaxI . . . . . . . . . . . . . . . . . . . . . . . . 8
MaxL . . . . . . . . . . . . . . . . . . . . . . . . 8
MaxW . . . . . . . . . . . . . . . . . . . . . . . . 8
MinI . . . . . . . . . . . . . . . . . . . . . . . . 8
MinL . . . . . . . . . . . . . . . . . . . . . . . . 9
MinW . . . . . . . . . . . . . . . . . . . . . . . . 9
Move16 . . . . . . . . . . . . . . . . . . . . . . . 9
MoveWindow . . . . . . . . . . . . . . . . . . . . . 9
MoveWords . . . . . . . . . . . . . . . . . . . . . . 9
RemoveWindow . . . . . . . . . . . . . . . . . . . . 10
RestoreBorder . . . . . . . . . . . . . . . . . . . . 10
RestoreTurboWindow . . . . . . . . . . . . . . . . . 10
SetCursorDefault . . . . . . . . . . . . . . . . . . 11
SetVirtualSize . . . . . . . . . . . . . . . . . . . 11
SetWindowModes . . . . . . . . . . . . . . . . . . . 11
ShowWindow . . . . . . . . . . . . . . . . . . . . . 12
TitleWindow . . . . . . . . . . . . . . . . . . . . . 12
VResizeWindow . . . . . . . . . . . . . . . . . . . . 12
VScrollView . . . . . . . . . . . . . . . . . . . . . 13
VUpdateCursor . . . . . . . . . . . . . . . . . . . . 13
VUpdateRows . . . . . . . . . . . . . . . . . . . . . 13
VUpdateTitles . . . . . . . . . . . . . . . . . . . . 13
VUpdateView . . . . . . . . . . . . . . . . . . . . . 14
VUpdateWindow . . . . . . . . . . . . . . . . . . . . 14
VViewRC . . . . . . . . . . . . . . . . . . . . . . . 14
VViewRCrel . . . . . . . . . . . . . . . . . . . . . 14
VZoomWindow . . . . . . . . . . . . . . . . . . . . . 15
WEosC . . . . . . . . . . . . . . . . . . . . . . . . 15
WEosLn . . . . . . . . . . . . . . . . . . . . . . . 15
WEosToRC . . . . . . . . . . . . . . . . . . . . . . 15
WEosR . . . . . . . . . . . . . . . . . . . . . . . . 16
WBrdrH . . . . . . . . . . . . . . . . . . . . . . . 16
WBrdrPart . . . . . . . . . . . . . . . . . . . . . . 16
WBrdrV . . . . . . . . . . . . . . . . . . . . . . . 16
WClrEol . . . . . . . . . . . . . . . . . . . . . . . 17
WClrEos . . . . . . . . . . . . . . . . . . . . . . . 17
WClrField . . . . . . . . . . . . . . . . . . . . . . 17
WClrFieldEos . . . . . . . . . . . . . . . . . . . . 17
2
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
WClrLine . . . . . . . . . . . . . . . . . . . . . . 18
WClrScr . . . . . . . . . . . . . . . . . . . . . . . 18
WClrTitle . . . . . . . . . . . . . . . . . . . . . . 18
WDelLine . . . . . . . . . . . . . . . . . . . . . . 18
WGotoEos . . . . . . . . . . . . . . . . . . . . . . 19
WGotoRC . . . . . . . . . . . . . . . . . . . . . . . 19
WInsLine . . . . . . . . . . . . . . . . . . . . . . 19
WLineH . . . . . . . . . . . . . . . . . . . . . . . 19
WLinePart . . . . . . . . . . . . . . . . . . . . . . 20
WLineV . . . . . . . . . . . . . . . . . . . . . . . 20
WriteAndViewPage . . . . . . . . . . . . . . . . . . 20
WriteToCRT . . . . . . . . . . . . . . . . . . . . . 21
WriteToHidden . . . . . . . . . . . . . . . . . . . . 21
WriteToPage . . . . . . . . . . . . . . . . . . . . . 21
WriteToVirtual . . . . . . . . . . . . . . . . . . . 21
WScrollDown . . . . . . . . . . . . . . . . . . . . . 22
WScrollUp . . . . . . . . . . . . . . . . . . . . . . 22
WWhereC . . . . . . . . . . . . . . . . . . . . . . . 22
WWhereR . . . . . . . . . . . . . . . . . . . . . . . 22
WWrite . . . . . . . . . . . . . . . . . . . . . . . 23
WWriteA . . . . . . . . . . . . . . . . . . . . . . . 23
WWriteC . . . . . . . . . . . . . . . . . . . . . . . 24
3. DATA STRUCTURE . . . . . . . . . . . . . . . . . . . . 25
Basic Types . . . . . . . . . . . . . . . . . . . . . 25
Typed Constants . . . . . . . . . . . . . . . . . . . 27
Untyped Constants . . . . . . . . . . . . . . . . . . 28
Global Variables . . . . . . . . . . . . . . . . . . 29
Dynamic Variables . . . . . . . . . . . . . . . . . . 32
APPENDIX A: MEMORY ALLOCATION . . . . . . . . . . . . . . 33
Global Memory . . . . . . . . . . . . . . . . . . . . 33
Dynamic Memory . . . . . . . . . . . . . . . . . . . 33
Code Size . . . . . . . . . . . . . . . . . . . . . . 34
APPENDIX B: ERROR MESSAGES . . . . . . . . . . . . . . . 35
3
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
1. I N T R O D U C T I O N
PURPOSE
This document is a technical reference manual describing each routine and
variable in detail in a format similar to the TP manual. The routines are
described in alphabetical order. Since this manual is on disk, you can
find your interest easily with any search utility.
Application - Because WNDW uses QWIK, all routines will perform in the
following applications:
. All video text modes - 0, 1, 2, 3 and 7.
. Any column mode - 40, 80, or variable.
. For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and
compatibles.
. With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
. Perform routines in both absolute and window-relative coordinates.
. Writes direct to high speed multi-tasking video buffers (MTVB).
COMMON PARAMETERS
Common Parameters - Most procedures use the same parameters. Rather than
repeating them for each routine, detailed descriptions for those parameters
are listed below.
Window Coordinates - Unless otherwise stated, all WNDW routines work in
window-relative coordinates. For simplicity, virtual routines check for
bounds to keep routines confined to the windows and screen. However, to be
fast, some other routines indicated in this document do not check for
bounds in the windows or on the screen, so be sure to stay in range. The
upper left column in a window is row 1, column 1, which is also called a
1-based coordinate system.
Row/Col - Row and Col were chosen in lieu of the X/Y scheme used in TP.
Since WNDW is for only text modes, the screen is treated like a word
processor with rows and columns. It is more intuitive to use the X/Y
scheme in graphics and the Row/Col scheme for text.
Rows/Cols - Using Rows/Cols is much easier than Row2/Col2 to describe the
height and width of a block such as:
MakeWindow (Row,Col,Rows,Cols,Wattr,Battr,Border,Name);
Should you decide to move the window, only Row and Col need to be changed,
and therefore Rows and Cols don't need to be mentally recalculated and
altered. Please keep Cols limited to one row.
NumOfRows/NumOfCols - These parameters indicate a relative shift from a
given point that can be positive or negative.
aStr - The window-relative writing routines WWrite and WWriteC actually use
QWIK to write this string. With an external trick of using a pointer, the
Chapter 1, Introduction Page 4
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
string isn't recopied the stack and thereby increasing speed even if hard-
coded strings are passed as a parameter.
ATTRIBUTES
*Attr - Use the convenient attribute constants for the foreground and
background colors supplied in the QWIK unit rather than having to use TP
functions or procedures to get a desired color, for example:
MakeWindow (1,1,8,8,White+BlueBG,Yellow+BlueBG,SingleBrdr,aWindow)
will make a window with a white on blue window and yellow on blue border.
All subsequent routines will use these attributes for writing. TextAttr is
also set to the window attribute in case the Turbo write routines are used.
The foreground constants in QWIK are duplicates of those in TP4 and are
repeated here for convenience:
Black = $00; DarkGray = $08;
Blue = $01; LightBlue = $09;
Green = $02; LightGreen = $0A;
Cyan = $03; LightCyan = $0B;
Red = $04; LightRed = $0C;
Magenta = $05; LightMagenta = $0D;
Brown = $06; Yellow = $0E;
LightGray = $07; White = $0F;
Blink = $80;
In addition, the QWIK background color constants were included to take
advantage of constant folding.
BlackBG = $00;
BlueBG = $10;
GreenBG = $20;
CyanBG = $30;
RedBG = $40;
MagentaBG = $50;
BrownBG = $60;
LightGrayBG = $70;
SameAttr = -1;
SameAttr - A powerful and unique feature of all WNDW routines is the use of
the constant SameAttr. If SameAttr, or a negative value, is used as an
attribute, the routine will suppress any changes to the attributes and use
what is currently on the screen.
Chapter 1, Introduction Page 5
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
2. P R O C E D U R E S A N D F U N C T I O N S
In this section, a detailed description is provided for each procedure and
function.
---------------------------------------------------------------------------
AccessWindow procedure Wndw
---------------------------------------------------------------------------
Function Randomly accesses a covered window and places it on the top.
If the window is hidden, it uses ShowWindow to put it on
top.
Declaration AccessWindow (WindowName: WindowNames)
Screens All video pages.
Remarks All underlays are properly updated in the heap with a high
speed technique. If NoAccessMode has been set for this
window or an invalid window name is used, the procedure is
simply ignored. Virtual windows are updated after being
shown. Zoom effect is optional. The WndwStats are shuffled
to match the new levels.
Restrictions Shadows are permitted, but exposed corners on lower level
windows with shadows will not be updated until moved. For
human factors, shadows are only recommended for the top
window anyway.
EOS Restored to new window.
Heap Temporarily uses (underlay size * 1.5).
Exit Forced to write to CRT.
See also HideWindow, ShowWindow
---------------------------------------------------------------------------
ChangeBorder procedure Wndw
---------------------------------------------------------------------------
Function Changes the border to a new border style.
Declaration ChangeBorder (NewBrdr: Borders)
Screens All video pages.
Remarks The original border style is already saved in ViewBrdr. The
current border is changed by searching for a match of WSbrdr
for each border part with the current attribute. If a match
is found, it is replaced with NewBrdr. Tees as well as
virtual borders are also replaced. The original border can
later be restored with RestoreBorder.
EOS Restored to CRT.
Exit Forced to write to CRT.
Restrictions NoBrdr is ignored as either the original or new border.
See also RestoreBorder
---------------------------------------------------------------------------
GetLevelIndex function Wndw
---------------------------------------------------------------------------
Function Returns the WndwStat index given the WindowName.
Declaration GetLevelIndex (WindowName: WindowNames)
Result type word
Remarks This routine scans for the first matching WindowName. It
scans from the top level index (LI) first and then down.
Hidden windows from the hidden level index (HLI) up are
Chapter 2, Procedures and Functions Page 6
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
scanned last. If no match is found, the result is >MaxWndw.
---------------------------------------------------------------------------
HeapOK function Wndw
---------------------------------------------------------------------------
Function Returns TRUE if enough heap is available from MaxAvail.
Declaration HeapOK (NumOfBytes: word)
Result type boolean
Remarks If there is insufficient heap, the program terminates
through the GOOF unit. The error window will display
MemAvail and MaxAvail. All WNDW procedures that use the
heap run this routine.
---------------------------------------------------------------------------
HideWindow procedure Wndw
---------------------------------------------------------------------------
Function Hides the current top window on the CRT.
Declaration HideWindow
Screens All video pages.
Remarks The window is saved in RAM and the underlay is restored on
the screen showing the new top window. If NoHideMode has
been set for this window, the procedure is ignored. The
windows are saved with the border, but without any shadow.
EOS Altered to (Wrow,Wcol) before hiding, then restored to the
new top window.
Heap Temporarily uses (underlay size * 1.5).
Exit Forced to write to CRT.
See also ShowWindow
---------------------------------------------------------------------------
InitWindow procedure Wndw
---------------------------------------------------------------------------
Function Initializes global data for WNDW routines. In brief, it
sets the defaults for WndwStat, indexes and margins for each
video page.
Declaration InitWindow (Wattr: integer; ClearScr: boolean);
Remarks This is the first routine required to executed early in the
main program and only needs to be done once. Wattr is the
attribute for the full screen (Window0) for all video pages.
If ClearScr is true, then all video pages are cleared with
Wattr. Over 50 variables are initialized with this
procedure. See InitWindow source code for details.
EOS Set to (1,1).
Heap Allocates VirtualStat and PageStat arrays as required.
See also SetCursorDefault, WNDW55.DOC and Data Structure section.
---------------------------------------------------------------------------
LocateCursor procedure Wndw
---------------------------------------------------------------------------
Function Locates the cursor within the window.
Declaration LocateCursor
Screens All video pages.
Remarks This routine, a subroutine of RestoreTurboWindow, locates
the cursor as set in the WndwStat for fixed or virtual
windows. It is usually handled automatically, but is
Chapter 2, Procedures and Functions Page 7
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
available for handling exceptions. VUpdateCursor is a
subroutine of LocateCursor.
See also RestoreTurboWindow, VUpdateCursor
---------------------------------------------------------------------------
MakeWindow procedure Wndw
---------------------------------------------------------------------------
Function Makes a window.
Declaration MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
BrdrSel: Borders; WindowName: WindowNames)
Screens All video pages.
Remarks This is the main routine to create windows. Row, Col, Row,
and Rows is the absolute coordinates for the window
inclusive of any border. For RelMode, (Row,Col) is window
relative. Wattr and Battr are the window and border
attributes, respectively (SameAttr is permitted). BrdrSel
is the selection of one of 15 different borders. WindowName
is a unique window name required for random access.
EOS Set to (1,1).
Heap Allocates underlay size until removed.
Restrictions Minimum size - (1x1) without borders, (3x3) with borders.
See also SetWindowModes, RemoveWindow
---------------------------------------------------------------------------
MaxI function Wutil
---------------------------------------------------------------------------
Function Returns the maximum value of two integers.
Declaration MaxI (Value1,Value2: integer)
Result type integer
Remarks High speed evaluation of two integers.
See also MaxL, MaxW, MinI, MinL, MinW
---------------------------------------------------------------------------
MaxL function Wutil
---------------------------------------------------------------------------
Function Returns the maximum value of two long integers.
Declaration MaxI (Value1,Value2: longint)
Result type longint
Remarks High speed evaluation of two long integers.
See also MaxI, MaxW, MinI, MinL, MinW
---------------------------------------------------------------------------
MaxW function Wutil
---------------------------------------------------------------------------
Function Returns the maximum value of two words.
Declaration MaxW (Value1,Value2: word)
Result type word
Remarks High speed evaluation of two words.
See also MaxI, MaxL, MinI, MinL, MinW
---------------------------------------------------------------------------
MinI function Wutil
---------------------------------------------------------------------------
Function Returns the minimum value of two integers.
Declaration MinI (Value1,Value2: integer)
Chapter 2, Procedures and Functions Page 8
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
Result type integer
Remarks High speed evaluation of two integers.
See also MaxI, MaxL, MaxW, MinL, MinW
---------------------------------------------------------------------------
MinL function Wutil
---------------------------------------------------------------------------
Function Returns the minimum value of two long integers.
Declaration MinI (Value1,Value2: longint)
Result type longint
Remarks High speed evaluation of two long integers.
See also MaxI, MaxL, MaxW, MinI, MinW
---------------------------------------------------------------------------
MinW function Wutil
---------------------------------------------------------------------------
Function Returns the minimum value of two words.
Declaration MinW (Value1,Value2: word)
Result type word
Remarks High speed evaluation of two words.
See also MaxI, MaxL, MaxW, MinI, MinL
---------------------------------------------------------------------------
Move16 procedure Wutil
---------------------------------------------------------------------------
Function Copies a specified number of contiguous bytes from a source
range to a destination range.
Declaration Move16 (VAR Source,Dest; NumOfBytes: word)
Remarks Exactly like TP's Move except twice as fast by using 16-bit
transfers. Use in lieu of Move.
See also MoveWords
---------------------------------------------------------------------------
MoveWindow procedure Wndw
---------------------------------------------------------------------------
Function Moves the current top window on the CRT a relative number of
rows and columns.
Declaration MoveWindow (NumOfRows,NumOfCols: integer)
Screens All video pages.
Remarks If NoMoveMode or PermMode has been set for this window, the
procedure is ignored. Shadows are fully supported. Margins
are respected.
EOS Moved relatively to the same place.
Heap Maximum requirement is full screen size plus the underlay
size.
Exit Forced to write to CRT.
See also ShowWindow
---------------------------------------------------------------------------
MoveWords procedure Wutil
---------------------------------------------------------------------------
Function Copies a specified number of contiguous bytes from a source
range to a destination range.
Declaration MoveWords (VAR Source,Dest; NumOfWords: word)
Remarks Even faster than Move16.
Chapter 2, Procedures and Functions Page 9
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
Restrictions Source and Dest[0] must not overlap.
See also Move16
---------------------------------------------------------------------------
RemoveWindow procedure Wndw
---------------------------------------------------------------------------
Function Removes the current top window on the CRT.
Declaration RemoveWindow
Screens All video pages.
Remarks Basically, the top window is removed restoring the underlay
and then erased from memory. Depending on the window mode,
RemoveWindow responds differently:
RelMode - The window-relative stats are simply
replaced with the parent window stats.
PermMode - The stats are simply dropped from the stack.
VirtualMode - The virtual screen is additionally removed
from the heap.
EOS Restored to the new top window.
Heap Deallocates the underlay.
Exit Forced to write to CRT.
See also MakeWindow
---------------------------------------------------------------------------
RestoreBorder procedure Wndw
---------------------------------------------------------------------------
Function Restores the border to the original border style.
Declaration RestoreBorder
Screens All video pages.
Remarks Reverses the effect of ChangeBorder by replacing the current
border style back to the original.
EOS Restored to CRT.
Exit Forced to write to CRT.
See also ChangeBorder
---------------------------------------------------------------------------
RestoreTurboWindow procedure Wndw
---------------------------------------------------------------------------
Function Restores attributes, cursor, and EOS marker for the current
window.
Declaration RestoreTurboWindow
Screens All video pages.
Remarks Usually this procedure is handled automatically. If there
is some exception in handling, then this procedure can be
used. It does the following:
. Resets TextAttr and ScrollAttr to OrigAttr
. Restores Turbo window
. Reset EOS marker to last saved location
. Resets cursor mode
. Locates cursor with LocateCursor
EOS Restored.
See also LocateCursor
Chapter 2, Procedures and Functions Page 10
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
SetCursorDefault procedure Wndw
---------------------------------------------------------------------------
Function Sets the default cursor mode to be used by MakeWindow.
Declaration SetCursorDefault (CursorMode: word)
Remarks This routine simply assigns a value to the global variable
CursorDefault. This value is already assigned by InitWindow
to the current cursor mode. If a specific cursor mode is
required for the initial window as well, use Qwik.SetCursor
instead before InitWindow.
See also InitWindow, MakeWindow
---------------------------------------------------------------------------
SetVirtualSize procedure Wndw
---------------------------------------------------------------------------
Function Sets the dimensions for the virtual screen of virtual
windows.
Declaration SetVirtualSize (Rows,Cols: byte)
Remarks This optional procedure sets the rows-by-columns dimensions
for a virtual screen. Keep in mind that two additional rows
will be internally added for titles if borders are used.
The default at startup is the CRT screen size.
Restrictions Maximum buffer size is 64k.
See also MakeWindow
Example Set the size for a virtual screen with 80 columns and a
maximum number of rows:
SetVirtualSize (253,80);
The resulting size would be (253+2)*80*2 = 40,800 bytes
which is under 64k. Rows 254 and 255 would be reserved for
top and bottom titles on the border.
---------------------------------------------------------------------------
SetWindowModes procedure Wndw
---------------------------------------------------------------------------
Function Sets the window modes to be used by MakeWindow.
Declaration SetWindowModes (SumOfAllModes: word)
Remarks There are several different modes that can be used:
RelMode - Window-relative frame of reference, no underlay
PermMode - Can't be moved or removed, no underlay
ShadowLeft - Shadow on the left side
ShadowRight - Shadow on the right side
ZoomMode - Zoom effect on Make, Show and AccessWindow
HiddenMode - Create window as hidden
VirtualMode - Create virtual screen as well
CursorOffMode - Leaves cursor off for window
SeeThruMode - Doesn't clear area inside window
NoHideMode - Ignores request to hide window
NoAccessMode - Ignores request to access window
NoMoveMode - Ignores request to move/resize window
The startup mode is equivalent to zero while the base window
Chapter 2, Procedures and Functions Page 11
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
is PermMode. The modes should be summed logically, but can
also be done arithmetically with care. All PermMode windows
must be created first.
See also MakeWindow
Example Set the modes for the next window to have a right shadow,
zoom effect, cursor off, and a virtual screen:
SetWindowModes (ShadowRight or ZoomMode or CursorOffMode
or VirtualMode);
Example Set the modes back to defaults:
SetWindowModes (0);
---------------------------------------------------------------------------
ShowWindow procedure Wndw
---------------------------------------------------------------------------
Function Shows a hidden window to become the current top window on
the CRT.
Declaration ShowWindow (WindowName: WindowNames)
Screens All video pages.
Remarks The underlay is saved from the screen and the window is
restored from RAM to become the new top window. Invalid
window names are simply ignored. Virtual windows are
updated before being shown. Zoom effect is optional.
EOS Set to (1,1).
Heap Temporarily uses (underlay size * 1.5).
Exit Forced to write to CRT.
See also HideWindow, AccessWindow
---------------------------------------------------------------------------
TitleWindow procedure Wndw
---------------------------------------------------------------------------
Function Places a title on the current window.
Declaration TitleWindow (TopOrBottom,Justify: DirType;
TitleAttr: integer; Title: string);
Screens All video pages.
Remarks There are six positions where the title can be placed in any
combination of Top or Bottom, and Left, Center, or Right.
TitleAttr is the title attribute (SameAttr is permitted).
The titles can be written to hidden windows or virtual
screens as well. TitleOfs can be adjusted for
justification.
EOS Unaltered.
See also TitleOfs in Data Structure section.
---------------------------------------------------------------------------
VResizeWindow procedure Wndw
---------------------------------------------------------------------------
Function Resizes the current top virtual window.
Declaration VResizeWindow (NumOfRows,NumOfCols: integer)
Remarks The top window is resized by moving the right and/or bottom
border. If NoMoveMode or PermMode has been set for this
window, the procedure is ignored. Shadows are fully
supported. Margins are respected.
Chapter 2, Procedures and Functions Page 12
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
Heap Maximum requirement is full screen size plus the underlay
size.
Exit Forced to write to CRT.
Restrictions None.
See also VZoomWindow
---------------------------------------------------------------------------
VScrollView procedure Wndw
---------------------------------------------------------------------------
Function Alters the upper left viewing reference point of the current
virtual screen by a relative number of rows and columns.
The view window is also updated no matter where its location
even if hidden or overlapped.
Declaration VScrollView (NumOfRows,NumOfCols: integer)
Remarks The reference point may be adjusted to keep the viewing
window within the virtual window limits. Works in any
"WriteTo" mode.
Heap If covered, WSrows * Wcols * 5 bytes is temporarily used.
Restrictions None.
See also VViewRC, VViewRCrel
---------------------------------------------------------------------------
VUpdateCursor procedure Wndw
---------------------------------------------------------------------------
Function Updates the current virtual window cursor if it is the top
window on the CRT.
Declaration VUpdateCursor
Remarks When the cursor is moved on the virtual screen, the cursor
may or may not be seen in the view. This routine updates
the location. Works in any "WriteTo" mode.
See also VUpdateTitles, VUpdateView, VUpdateWindow
---------------------------------------------------------------------------
VUpdateRows procedure Wndw
---------------------------------------------------------------------------
Function Updates certain rows in the current virtual window view only
on the top window.
Declaration VUpdateRows (Row,Rows: byte)
Remarks This routine is primarily used for fast response for spot
updates for data entry or the like where the fastest speed
is desirable. If the window is not the top window, the
entire view is updated.
See also VUpdateView, VUpdateWindow
---------------------------------------------------------------------------
VUpdateTitles procedure Wndw
---------------------------------------------------------------------------
Function Updates the current virtual window titles. It is also
updated no matter where its location even if hidden or
overlapped.
Declaration VUpdateTitles
Remarks This routine updates the titles to the window and truncates
them to fit in the current view. Works in any "WriteTo"
mode.
Heap If covered, WSrows * Wcols * 5 bytes is temporarily used.
Chapter 2, Procedures and Functions Page 13
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
See also VUpdateCursor, VUpdateView, VUpdateWindow
---------------------------------------------------------------------------
VUpdateView procedure Wndw
---------------------------------------------------------------------------
Function Updates the current virtual window view. It is also updated
no matter where its location even if hidden or overlapped.
Declaration VUpdateView
Remarks This routine updates the full view of the window. Works in
any "WriteTo" mode.
Heap If covered, WSrows * Wcols * 5 bytes is temporarily used.
See also VUpdateRows, VUpdateTitles, VUpdateWindow
---------------------------------------------------------------------------
VUpdateWindow procedure Wndw
---------------------------------------------------------------------------
Function Updates the current virtual window including the view,
titles and the cursor. It is also updated no matter where
its location even if hidden or overlapped.
Declaration VUpdateWindow
Remarks This is the main routine to update virtual windows. This
routine simply executes three procedures: VUpdateCursor,
VUpdateView, and VUpdateTitles. Works in any "WriteTo"
mode.
Heap If covered, WSrows * Wcols * 5 bytes is temporarily used.
See also VUpdateCursor, VUpdateRows, VUpdateTitles, VUpdateView
---------------------------------------------------------------------------
VViewRC procedure Wndw
---------------------------------------------------------------------------
Function Alters the upper left viewing reference point of the current
virtual window.
Declaration VViewRC (Row,Col: byte)
Remarks The reference point may be adjusted to keep the viewing
window within the virtual window limits. Works in any
"WriteTo" mode. It does not update the viewing window.
Restrictions None.
See also VViewRCrel, VScrollView
---------------------------------------------------------------------------
VViewRCrel procedure Wndw
---------------------------------------------------------------------------
Function Alters the upper left viewing reference point of the current
virtual window by a relative number of rows and columns.
Declaration VViewRCrel (NumOfRows,NumOfCols: integer)
Remarks The reference point may be adjusted to keep the viewing
window within the virtual window limits. Works in any
"WriteTo" mode. It does not update the viewing window.
Restrictions None.
See also VViewRC, VScrollView
Chapter 2, Procedures and Functions Page 14
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
VZoomWindow procedure Wndw
---------------------------------------------------------------------------
Function Toggles top virtual window between full screen size and
original size.
Declaration VZoomWindow
Remarks If the window is less than full size, the window is zoomed
to full size and centered if necessary. Executing the
procedure again will restore the size and location of this
window. If NoMoveMode or PermMode has been set for this
window, the procedure is ignored. Shadows are fully
supported. Margins are respected.
Heap Maximum requirement is full screen size plus the underlay
size.
Exit Forced to write to CRT.
See also VResizeWindow
---------------------------------------------------------------------------
WEosC function Wndw
---------------------------------------------------------------------------
Function Returns the window-relative column of the EOS marker.
Declaration WEosC
Result type byte
Screens All video pages and virtual screens.
Remarks Operates on the currently written screen. The upper left
corner of the window is (1,1).
See also WEosR, WEosToRC, WEosLn, WGotoEos
---------------------------------------------------------------------------
WEosLn procedure Wndw
---------------------------------------------------------------------------
Function Moves the EOS marker to column 1 of the next window-relative
row with a possible scroll up.
Declaration WEosLn
Screens All video pages and virtual screens.
Remarks Operates on the currently written window. If WEosR becomes
greater than the number of window rows, then the window will
scroll up. The new blank row will have the attribute set by
WndwAttr which is the window attribute.
EOS Updated to first cleared column of the cleared row.
See also WEosR, WEosC, WEosToRC, WGotoEos
---------------------------------------------------------------------------
WEosToRC procedure Wndw
---------------------------------------------------------------------------
Function Positions the EOS marker relative to the current window.
Declaration WEosToRC (Row, Col: byte)
Screens All video pages and virtual screens.
Remarks Use this procedure to manually locate the EOS marker. All
EOS procedures will write where this marker is located on
the currently written screen.
EOS Updated.
Restrictions Stay within the window limits.
See also QWIK, WEosR, WEosC, WEosLn, WGotoEos
Chapter 2, Procedures and Functions Page 15
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
WEosR function Wndw
---------------------------------------------------------------------------
Function Returns the window-relative row of the EOS marker.
Declaration WEosR
Result type byte
Screens All video pages and virtual screens.
Remarks Operates on the currently written screen. The upper left
corner of the window is (1,1).
See also WEosC, WEosToRC, WEosLn, WGotoEos
---------------------------------------------------------------------------
WBrdrH procedure Wndw
---------------------------------------------------------------------------
Function Places a horizontal partition of the same type as the window
border from edge to edge of the border.
Declaration WBrdrH (Row: byte)
Screens All video pages and virtual screens.
Remarks This routine divides a window using WSbrdr, BrdrAttr from
the top window record. It provides a horizontal line
complete with a tee on each end using parts BrdrHL, BrdrLT,
and BrdrRT. If SameAttr is used for BrdrAttr, then the
attributes will remain the same on the screen. If there is
no border, the procedure is ignored.
EOS Unaltered.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrPart, WBrdrV, WLineH, WLinePart, WLineV
---------------------------------------------------------------------------
WBrdrPart procedure Wndw
---------------------------------------------------------------------------
Function Places a single border part of the same type as the window
border at a window-relative location.
Declaration WBrdrPart (Row,Col: byte; Part: BrdrParts)
Screens All video pages and virtual screens.
Remarks This routine places the part using WSbrdr, BrdrAttr from the
top window record. It is usually used for crosses or tees,
but there are 15 different parts that can be used. If
SameAttr is used for BrdrAttr, then the attributes will
remain the same on the screen. If there is no border, the
procedure is ignored.
EOS Unaltered.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
---------------------------------------------------------------------------
WBrdrV procedure Wndw
---------------------------------------------------------------------------
Function Places a vertical partition of the same type as the window
border from edge to edge of the border.
Declaration WBrdrV (Row: byte)
Screens All video pages and virtual screens.
Remarks This routine divides a window using WSbrdr, BrdrAttr from
the top window record. It provides a vertical line complete
with a tee on each end using parts BrdrVL, BrdrTT, and
Chapter 2, Procedures and Functions Page 16
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
BrdrBT. If SameAttr is used for BrdrAttr, then the
attributes will remain the same on the screen. If there is
no border, the procedure is ignored.
EOS Unaltered.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
---------------------------------------------------------------------------
WClrEol procedure Wndw
---------------------------------------------------------------------------
Function Clears a row to End-Of-Line (EOL).
Declaration WClrEol (Row,Col: byte; Attr: integer)
Screens All video pages and virtual screens.
Remarks The row is cleared using the attribute Attr (SameAttr is
permitted). To force the window attribute, use
TWS.WndwAttr.
EOS Set to (Row,Col).
Restrictions Stay within window limits.
See also WDelLine, WClrLine, WClrEos
---------------------------------------------------------------------------
WClrEos procedure Wndw
---------------------------------------------------------------------------
Function Clears a row from EOS to End-Of-Line.
Declaration WClrEos (Attr: integer)
Screens All video pages and virtual screens.
Remarks The row is cleared starting at the EOS marker using the
attribute Attr (SameAttr is permitted). To force the window
attribute, use TWS.WndwAttr.
EOS Unaltered.
Restrictions Stay within window limits.
See also WDelLine, WClrLine, WClrEos
---------------------------------------------------------------------------
WClrField procedure Wndw
---------------------------------------------------------------------------
Function Clears a field.
Declaration WClrField (Row,Col,Cols: byte; Attr: integer)
Screens All video pages and virtual screens.
Remarks The field is cleared starting at (Row,Col) using the
attribute Attr (SameAttr is permitted). To force the window
attribute, use TWS.WndwAttr.
EOS Set to (Row,Col).
Restrictions Stay within window limits.
See also WClrEol, WClrEos, WClrFieldEos
---------------------------------------------------------------------------
WClrFieldEos procedure Wndw
---------------------------------------------------------------------------
Function Clears a field starting at EOS.
Declaration WClrFieldEos (Cols: byte; Attr: integer)
Screens All video pages and virtual screens.
Remarks The field is cleared starting at EOS using the attribute
Attr (SameAttr is permitted). To force the window
attribute, use TWS.WndwAttr.
Chapter 2, Procedures and Functions Page 17
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
EOS Unaltered.
Restrictions Stay within window limits.
See also WClrEol, WClrEos, WClrField
---------------------------------------------------------------------------
WClrLine procedure Wndw
---------------------------------------------------------------------------
Function Clears a specified row.
Declaration WClrLine (Row: byte)
Screens All video pages and virtual screens.
Remarks The row is cleared using the window attribute TWS.WndwAttr
(SameAttr is permitted).
EOS Set to (Row,1).
Restrictions Stay within window limits.
See also WDelLine, WClrEol, WClrEos
---------------------------------------------------------------------------
WClrScr procedure Wndw
---------------------------------------------------------------------------
Function Clears the entire window.
Declaration WClrScr
Screens All video pages and virtual screens.
Remarks Clears the screen using the window attribute TWS.WndwAttr
(SameAttr is permitted).
EOS Set to (1,1).
See also WClrLine, WDelLine, WInsLine
---------------------------------------------------------------------------
WClrTitle procedure Wndw
---------------------------------------------------------------------------
Function Clears the titles from the specified row.
Declaration WClrTitle (TopOrBottomRow: DirType);
Screens All video pages and virtual screens.
Remarks Clears the top or bottom border where the titles are located
and restores the original border if any. If WSbrdr=NoBrdr,
the row is simply cleared. Works on both fixed and virtual
titles.
EOS Unaltered.
See also TitleWindow, VUpdateTitle
---------------------------------------------------------------------------
WDelLine procedure Wndw
---------------------------------------------------------------------------
Function Deletes a line at a specified row, scrolls up the remaining
part of the window and clears the bottom row.
Declaration WDelLine (Row: byte)
Screens All video pages and virtual screens.
Remarks Similar to Turbo's DelLine, the indicated row of the window
will be deleted. The bottom row is cleared with WndwAttr
(SameAttr is permitted). The cursor is not moved, but is
ready to be moved with WGotoEos as EOS is set to the first
column of the cleared row.
EOS Updated to first cleared column of the cleared row.
Restrictions Stay within window limits.
See also WInsLine, WScrollUp, WGotoEos
Chapter 2, Procedures and Functions Page 18
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
WGotoEos procedure Wndw
---------------------------------------------------------------------------
Function Positions the cursor to match the EOS marker on both fixed
or virtual windows.
Declaration WGotoEos
Screens All video pages and virtual screens.
Remarks The cursor is simply moved to match the position of the EOS
marker of the currently written video page. TWS.WSwhereR
and TWS.WSwhereC are also updated. For virtual windows,
this routine also executes VUpdateCursor.
EOS Unaltered.
See also WEosR, WEosC, WEosToRC, WEosLn, WGotoRC, VUpdateCursor
Restrictions EOS should be within window limits.
Example Center a string in a window and place the cursor at the end
of the string:
WWriteC (1,'Correct (Y/N)? ');
WGotoEos;
---------------------------------------------------------------------------
WGotoRC procedure Wndw
---------------------------------------------------------------------------
Function Positions the cursor relative to the window.
Declaration WGotoRC (Row, Col: byte)
Screens All video pages and virtual screens.
Remarks The cursor is positioned to the currently written window.
For virtual windows, this routine also executes
VUpdateCursor.
EOS Unaltered.
Restrictions Stay within the window limits.
See also WGotoEos, WhereR, WhereC
---------------------------------------------------------------------------
WInsLine procedure Wndw
---------------------------------------------------------------------------
Function Inserts a blank line at a specified row using the window
attribute WndwAttr scrolling down the remaining part.
Declaration WInsLine (Row: byte)
Screens All video pages and virtual screens.
Remarks Similar to Turbo's InsLine, the indicated row of the window
is scrolled down and then cleared (SameAttr is permitted).
The cursor is not moved, but is ready to be moved with
WGotoEos as EOS is set to the first column of the cleared
row.
EOS Updated to first cleared column of the cleared row.
Restrictions Stay within window limits.
See also WDelLine, WScrollDown, WGotoEos
---------------------------------------------------------------------------
WLineH procedure Wndw
---------------------------------------------------------------------------
Function Places a horizontal line in the window using the window line
set.
Chapter 2, Procedures and Functions Page 19
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
Declaration WLineH (Row,Col,Cols: byte)
Screens All video pages and virtual screens.
Remarks This routine divides a window using WSline, WndwAttr from
the top window record. It provides just a horizontal line
using part BrdrHL. If SameAttr is used for WndwAttr, then
the attributes will remain the same on the screen. If
WSline=NoBrdr, then the procedure is ignored.
EOS Updated.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrH, WBrdrPart, WBrdrV, WLinePart, WLineV
---------------------------------------------------------------------------
WLinePart procedure Wndw
---------------------------------------------------------------------------
Function Places a single line part of the same type as the window
line set at a window-relative location.
Declaration WLinePart (Row,Col: byte; Part: BrdrParts)
Screens All video pages and virtual screens.
Remarks This routine places the part using WSline, WndwAttr from the
top window record. It is usually used for crosses or tees,
but there are 15 different parts that can be used. If
SameAttr is used for WndwAttr, then the attributes will
remain the same on the screen. If WSline=NoBrdr, the
procedure is ignored.
EOS Updated.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrH, WBrdrPart, WBrdrV, WLineH, WLineV
---------------------------------------------------------------------------
WLineV procedure Wndw
---------------------------------------------------------------------------
Function Places a vertical line in the window using the window line
set.
Declaration WLineV (Row,Col,Rows: byte)
Screens All video pages and virtual screens.
Remarks This routine divides a window using WSline, WndwAttr from
the top window record. It provides just a vertical line
using part BrdrVL. If SameAttr is used for WndwAttr, then
the attributes will remain the same on the screen. If
WSline=NoBrdr, then the procedure is ignored.
EOS Updated.
Restrictions Stay within window limits. Cannot use NoBrdr.
See also WBrdrH, WBrdrPart, WBrdrV, WLineH, WLinePart
---------------------------------------------------------------------------
WriteAndViewPage procedure Wndw
---------------------------------------------------------------------------
Function Changes the video page to be both viewed and written on the
CRT.
Declaration WriteAndViewPage (PageNum: byte)
Screens All video pages.
Remarks If another video page is available, this routine will switch
to both view and write to that page. It does nothing if
PageNum is already the currently written video page
(QvideoPage) and viewed page (VideoPage), or if PageNum is
Chapter 2, Procedures and Functions Page 20
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
invalid. All WndwStats are swapped to exact same conditions
as before.
EOS Restored to new page.
See also WriteToPage, Qwik.QviewPage, Qwik.QwritePage
---------------------------------------------------------------------------
WriteToCRT procedure Wndw
---------------------------------------------------------------------------
Function Prepares QWIK and WNDW to write to the top window on the CRT
and restores the Turbo window.
Declaration WriteToCRT
Screens Back to any video page.
Remarks This procedure switches back to writing to the top window on
the CRT after writing to a hidden window or virtual screen.
EOS Restored to top window.
See also WriteToHidden, WriteToVirtual
---------------------------------------------------------------------------
WriteToHidden procedure Wndw
---------------------------------------------------------------------------
Function Prepares QWIK and WNDW to write to a hidden window.
Declaration WriteToHidden (WindowName: WindowNames)
Remarks This procedure switches to writing to a hidden window. The
window must be a valid window name, otherwise the program is
terminated with an error message.
EOS Restored to hidden window.
See also WriteToCRT, WriteToVirtual
---------------------------------------------------------------------------
WriteToPage procedure Wndw
---------------------------------------------------------------------------
Function Changes the video page on which the WNDW routines write with
out changing the viewed page.
Declaration WriteToPage (PageNum: byte)
Screens All video pages.
Remarks If another video page is available, this routine will switch
to write to that page. It does nothing if PageNum is
already the currently written video page (QvideoPage) or if
the page is invalid. All WndwStats are swapped to exact
same conditions as before.
EOS Restored to new page.
See also WriteAndViewPage, Qwik.QwritePage
---------------------------------------------------------------------------
WriteToVirtual procedure Wndw
---------------------------------------------------------------------------
Function Prepares QWIK and WNDW to write to a virtual screen.
Declaration WriteToVirtual (WindowName: WindowNames)
Remarks This procedure switches to writing to a virtual screen. The
window must be a valid window name, otherwise, the program
is terminated with an error message.
EOS Restored to virtual screen.
See also WriteToCRT, WriteToHidden
Chapter 2, Procedures and Functions Page 21
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
WScrollDown procedure Wndw
---------------------------------------------------------------------------
Function Scrolls the current window down and clears the top row with
the window attribute WndwAttr.
Declaration WScrollDown
Screens All video pages and virtual screens.
Remarks The last row of the window will be scrolled out and lost
while the first row will be cleared (SameAttr is permitted).
The cursor is not moved, but is ready to be moved with
WGotoEos as EOS is set to the first column of the cleared
row.
EOS Updated to first cleared column of the cleared row.
Restrictions None.
See also WScrollUp, WGotoEos
---------------------------------------------------------------------------
WScrollUp procedure Wndw
---------------------------------------------------------------------------
Function Scrolls the current window up and clears the bottom row with
the window attribute WndwAttr.
Declaration WScrollUp
Screens All video pages and virtual screens.
Remarks The first row of the window will be scrolled out and lost
while the last row will be cleared (SameAttr is permitted).
The cursor is not moved, but is ready to be moved with
WGotoEos as EOS is set to the first column of the cleared
row.
EOS Updated to first cleared column of the cleared row.
Restrictions None.
See also WScrollDown, WGotoEos
---------------------------------------------------------------------------
WWhereC function Wndw
---------------------------------------------------------------------------
Function Returns the window-relative column of the cursor on the
currently written video page.
Declaration WWhereC
Result type byte
Screens All video pages only.
Remarks Operates on the currently written video page. The upper
left corner of the screen is (1,1).
See also WGotoRC, WWhereR
---------------------------------------------------------------------------
WWhereR function Wndw
---------------------------------------------------------------------------
Function Returns the window-relative row of the cursor on the
currently written video page.
Declaration WWhereR
Result type byte
Screens All video pages only.
Remarks Operates on the currently written video page. The upper
left corner of the screen is (1,1).
See also WGotoRC, WWhereC
Chapter 2, Procedures and Functions Page 22
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
---------------------------------------------------------------------------
WWrite procedure Wndw
---------------------------------------------------------------------------
Function Writes a string relative to the current window using the
window attribute.
Declaration WWrite (Row,Col: byte; aStr: string)
Screens All video pages and virtual screens.
Remarks This routine writes the string aStr at window-relative
(Row,Col) with the attribute WndwAttr from the window
record. If SameAttr is used for WndwAttr, then the
attributes will remain the same on the screen.
EOS Updated.
Restrictions Stay within the window limits. Long strings will not wrap
around to column 1.
See also WWriteC, WWriteA
Example Write the string "Enter" at (2,1) with the current window
attribute:
WWrite (2,1,'Enter');
Example Write the string "Answer" at (2,1) with the attribute of
flashing white on red and then restore the current window
attribute:
with TopWndwStat do
begin
WndwAttr := Blink+White+RedBG;
Wwrite (2,1,'Answer');
WndwAttr := OrigAttr;
end;
---------------------------------------------------------------------------
WWriteA procedure Wndw
---------------------------------------------------------------------------
Function Writes an array (or string) with a specified length relative
to the current window using the window attribute.
Declaration WWriteA (Row,Col: byte; ArrayLength: word; VAR aStr)
Screens All video pages and virtual screens.
Remarks This routine writes the array aStr at window-relative
(Row,Col) for the number of columns specified by
ArrayLength. This enables you to write substrings when
specifying a starting index (aStr[i]). (Other routines like
WWrite assume the length is the value at aStr[0] and the
starting index is aStr[1].) Of course, aStr doesn't have to
be a string - it can be any type variable or address in
memory. The attribute used is WndwAttr from the window
record. If SameAttr is used for WndwAttr, then the
attributes will remain the same on the screen.
EOS Updated.
Restrictions Stay within the window limits. Long strings will not wrap
around to column 1.
See also WWrite, WWriteC
Example The following will write "Testing out this line." with the
current window attribute:
Chapter 2, Procedures and Functions Page 23
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
MyString:='Step B: Testing out this line.';
WWriteA (1,1,22,MyString[9]);
---------------------------------------------------------------------------
WWriteC procedure Wndw
---------------------------------------------------------------------------
Function Writes a string centered column-wise to the current window
using the window attribute.
Declaration WWriteC (Row: byte; aStr: string)
Screens All video pages and virtual screens.
Remarks This routine writes the string aStr centered between the
left and right columns of the window. The attribute used is
WndwAttr from the window record. If SameAttr is used for
WndwAttr, then the attributes will remain the same on the
screen.
EOS Updated.
Restrictions Stay within the window limits. Long strings will not wrap
around to column 1.
See also WWrite, WWriteA
Example Write a message centered in a window on row 5:
WWriteC (5,'My message');
Chapter 2, Procedures and Functions Page 24
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
3. D A T A S T R U C T U R E
This section will help describe the data structure of WNDW and how it can
be adjusted. The variables in W55-VAR.INC are allocated according to the
conditional directives and constants set at the beginning of the file.
There are several basic variables, but if desired, there are additional
variables for virtual windows and multiple video pages. Please refer to
the source code in W55-VAR.INC for the exact listing.
BASIC TYPES
Basic Types - These types are used for all windows and modes to define the
data structure. This will describe the purpose of each type.
Type Description
------------ -----------------------------------------------------------
Borders This enumerated type gives a name for 15 different border
styles each having 15 different parts already assigned in
the constant array Brdr. The name NoBrdr is reserved.
NoBrdr - No border at all. Just the text area.
BlankBrdr - Blank character on all sides.
SingleBrdr - Single lines on all sides.
DoubleBrdr - Double lines on all sides.
HdoubleBrdr - Horizontal double lines. Single
vertical lines.
VdoubleBrdr - Vertical double lines. Single
horizontal lines.
SolidBrdr - Solid box character on all sides.
EvenSolidBrdr - Vertical solid box. Horizontal half
box.
ThinSolidBrdr1 - Half box on all sides. Squeezed
horizontally.
ThinSolidBrdr2 - Half box on all sides. Squeezed
vertically.
LhatchBrdr - Light hatch character on all sides.
MhatchBrdr - Medium hatch character on all sides.
HhatchBrdr - Heavy hatch character on all sides.
UserBrdr1 - User defined border.
UserBrdr2 - User defined border.
BrdrParts Each border has 15 different parts. This enumerated type
identifies each part by name. Using acronyms, the relative
position can be easily identified. For example, BrdrTL
means the Top Left border part. The order corresponds with
the BrdrRec type:
Relative Position The first letter means:
------------------ T = Top B = Bottom
TL TH TT TH TR V = Vertical H = Horizontal
LV VL RV L = Left R = Right
LT HL CL HL RT C = Cross
LV VL RV Second letter exceptions:
BL BH BT BH BR T = Tee L = Line
Chapter 3, Data Structure Page 25
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
BrdrRec This type provides the structure for each border style to
access all 15 different parts. By having a tag field, two
different methods can be used to address the parts.
DirType This enumerated type identifies various directions. They
can be extended.
MarginRec Groups the margins used for moving or resizing windows.
WindowNames This enumerated type gives a name or handle for each window
to uniquely identify a window record for random access.
Any additional name can be used, but three are reserved:
Name Description
---------- ---------------------------------------------
Window0 Identifies the initial base screen and must be
first in the list.
FreeWindow Identifies virtual screen records that are
free to be overwritten.
aWindow A generic name to be used when the window does
not need to be unique. It is usually used for
temporary windows like error messages.
WndwStatType This type sets up the basic structure to a window record.
Each field in record is worth describing. The WS prefix is
an acronym meaning WndwStat. There is 50 bytes per record.
WSrow .. WScol2 - These variables identify the location
and size of the window INCLUDING the border if any. The
"2" suffix means the right column or bottom row location.
Wrow .. Wcol2 - These variables identify the location
and size of the window EXCLUDING the border if any. The
"2" suffix means the right column or bottom row location.
WndwAttr/BrdrAttr/OrigAttr - These the attributes for the
window and border respectively. The value can even be
SameAttr. OrigAttr is a second copy of WndwAttr used to
restore WndwAttr to its original value.
WSbrdr/WSline - The former is the current border style
while the latter is a line set that can be used within
the window. When a window is made, these two values are
the same, but WSline is available to be changed to the
needed line set.
WSname - The unique name assigned to the window record.
WSwhereR/WSwhereC - These variables save the window-
relative row and column of the cursor.
WSmodes - Saves all the modes that created the window
including the current status.
Chapter 3, Data Structure Page 26
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
WScursor - Save the cursor mode used with this window.
ULcol .. ULbytes - Saves the location and size of the
underlay of a window including the border and shadow if
any.
ULptr - Points to the saved underlay in the heap.
VScrRec - Holds the QWIK screen data for this window.
RefRow/RefCol - These two scratch coordinates are used
for two cases. It saves the absolute row/col where a
window is positioned before it is hidden. For virtual
screen stats, it saves the view reference point.
ViewBrdr - Saves the border style originally created with
the window. WSbrdr differs from ViewBrdr in that WSbrdr
contains the current border. For virtual screens, WSbrdr
is always NoBrdr even though the view on the CRT may be a
different style.
VI - Virtual screen index for its associated virtual
window stat if any.
WndwStatsType Sets up the total number of WndwStat records for the
program which defined by the constant MaxWndw.
VirtualStatsType Sets up the total number of VirtualStat records for the
program which defined by the constant MaxVirtualWndw.
WordArray Used to identify each Character/Attribute combination from
a screen. The range of the array is irrelevant.
WordArrayPtrType A pointer of WordArray.
TYPED CONSTANTS
Typed Constants - These constants set defaults used to create window
borders, shadows and titles.
Constant Description
------------ -----------------------------------------------------------
Brdr Contains 14 different border styles each with 15 border
parts. The flexible data structure enables you to get
parts with either of two methods - by field identifier or
by index name. For example, it is easiest to use the field
identifier:
MyPart := Brdr[SingleBrdr].TL
Since field identifiers can't be passed as parameters, the
index names must be used. To get the same result if the
name BrdrTL is passed as a value:
Chapter 3, Data Structure Page 27
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
MyPart := Brdr[SingleBrdr].BrdrArray[BrdrTL]
Both methods use the same code; the former is simply easier
to write.
PreferMultiTask This boolean defaults to false so that would ignore any
multi-tasking environment. When set to true just before
InitWindow, WNDW will then use the higher speed video
buffer (MTVB) if available.
ShadowChar This is the character used to produce a shadow which is
set equal to a space. This may not be desirable for
monochrome monitors which may look better with hatch
characters.
ShadowColor This is the attribute used to produce a shadow which is set
to Black on Black. Any attribute can be used.
TitleOfs When writing titles, this offset is used to adjust where
the title starts writing. Left justified titles start
at Wcol+TitleOfs while the Right end at Wcol2-TitleOfs.
Center justified titles are not affected. The default is
1.
UNTYPED CONSTANTS
Untyped Constants - These constants are used to control the data structure
size or to conveniently set window mode bits.
Constant Value Description
-------------- ----- --------------------------------------------------
MaxWndw 1-254 Set by the user, this value determines the maximum
number of windows that can be on the CRT on any
video page. This sets the amount of global data
to be used.
MaxVirtualWndw 0-254 Set by the user, this value determines the total
number of virtual screens minus one that will be
maintained at any one time. If no virtual windows
are wanted, undefine the directive AddVirtual.
MaxPageUsed 0 - 7 Set by the user, this value determines the highest
page number to be managed in a multi-page program.
If only page 0 is going to be used (which is
usually the case), then undefine the directive
MultiPage. This will reduce the global data by a
significant amount.
Window Modes - There are several window modes and combination of modes that
can be set using SetWindowModes and saved in the variable WindowModes.
This is a list of those modes, values and descriptions. After the window
is created, the modes are saved in WSmodes as well as the "To*" modes which
indicates the status of the window.
Chapter 3, Data Structure Page 28
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
Constant Value Description
-------------- ----- --------------------------------------------------
RelMode $0001 (Bit 0) Simply overwrites the screen relative to
the current window. The Row/Col coordinate is
window relative. Works and stays in the current
WriteTo mode. This is usually used for flexible
screen design. The stats are only temporary and
lost after changing windows. To get back to the
parent window, use RemoveWindow.
PermMode $0002 (Bit 1) Makes the window permanent on the screen -
no underlay is saved. These windows must be the
first ones created. They can be accessed, but be
sure no other window is covering it (WI<=PLI)
because they are not necessarily the top window.
before writing to the screen.
ShadowLeft $0004 (Bit 2) Places a shadow on the left side.
ShadowRight $0008 (Bit 3) Places a shadow on the right side.
ZoomMode $0010 (Bit 4) Creates a zoom effect with MakeWindow,
ShowWindow, and AccessWindow.
HiddenMode $0020 (Bit 5) Creates the window as hidden.
VirtualMode $0040 (Bit 6) Creates a virtual window with a virtual
screen.
CursorOffMode $0080 (Bit 7) Always leaves cursor off.
SeeThruMode $0100 (Bit 8) Doesn't clear screen inside the border and
ignores ZoomMode.
NoHideMode $0200 (Bit 9) Ignores request to hide window.
NoAccessMode $0400 (Bit 10) Ignores request to access window.
NoMoveMode $0800 (Bit 11) Ignores request to move/resize window.
ToCRTmode $1000 (Bit 12) Indicates writing to CRT.
ToHiddenMode $2000 (Bit 13) Indicates writing to hidden window.
ToVirtualMode $4000 (Bit 14) Indicates writing to virtual screen.
GLOBAL VARIABLES
Global Variables - Finally, the variables used in WNDW can be described in
detail and can be accessed by the user.
Window Flags - While writing to a window, it is difficult to try to analyze
the bits in WSmodes to figure out its modes. So, each mode has been given
a corresponding boolean flag. These flags are set for the current window.
Though rather intuitive, the flag variables is listed below with its
corresponding mode:
Flag Mode
-------------- --------------
RelFlag RelMode
PermFlag PermMode
ZoomFlag ZoomMode
HiddenFlag HiddenMode
VirtualFlag VirtualMode
CursorOffFlag CursorOffMode
SeeThruFlag SeeThruMode
NoHideFlag NoHideMode
Chapter 3, Data Structure Page 29
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
NoAccessFlag NoAccessMode
NoMoveFlag NoMoveMode
ToCRTflag ToCRTmode
ToHiddenFlag ToHiddenMode
ToVirtualFlag ToVirtualMode
Single Page Variables - The following variables are grouped together
because they are specific to the current video page being used. If you do
use more than one page, these variables will be swapped with another page.
Variable Description
-------------- ---------------------------------------------------------
WndwStat (Type: WndwStatsType) This is the array for the maximum
number of windows both hidden and shown at one time.
Each record only uses 52 bytes of global data.
WndwStat[0] is always the record for the initial window.
TopWndwStat (Type: WndwStatsType) This record makes it easy to
always access the data for the current window and is
always up-to-date. This data will be saved in the
correct WndwStat before accessing another window.
TWS (Type: WndwStatsType) This is the same as TopWndwStat,
but just easier to write.
TopVirtualStat (Type: WndwStatsType) For virtual windows, in addition
to TWS, there is the TopVirtualStat for the associated
virtual screen which has its own record.
TVS (Type: WndwStatsType) This is the same as
TopVirtualStat, but just easier to write. Keep in mind
that when writing direct to the virtual screen
(WriteToVirtual), TWS and TVS are reversed. It would
then be helpful to think of TVS as the top VIEW stat,
since the view is on the CRT.
LI (Type: Word) This is the top Level Index for the top
window currently shown on the CRT. Windows shown on the
CRT are sequentially stacked from index 0 upward.
HLI (Type: Word) This is the Hidden Level Index which are
stacked from index equal to MaxWndw downward. If there
are no hidden windows, HLI=MaxWndw+1.
WI (Type: Word) For the current Window Index, the program
saves and retrieves the WndwStat from this index whether
it is hidden or shown. It ranges from 0 to MaxWndw. For
hidden windows, can range from HLI to MaxWndw. For the
top window on the CRT, WI=LI. For PermMode windows, it
can be <=LI.
PLI (Type: Byte) This Permanent Level Index keeps track of
the order of the permanent windows on the CRT. They must
be stacked contiguously as the first ones on the CRT or
else an error message will be displayed. This value is
Chapter 3, Data Structure Page 30
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
<=LI.
CursorDefault (Type: word) This is the value saved from
SetCursorDefault for the cursor mode which can be just as
easily set directly. When MakeWindow is used, this is
the value saved for that window.
Margins (Type: MarginRec) These margins limit the moving or
resizing of windows for each video page. This prevents
windows from covering status lines or the like.
WindowModes (Type: word) This is the value saved from
SetWindowModes. It is best to use the procedure for this
value since it filters out incompatible modes.
TopPageStat (Type: PageStatRec) Rather than being redundant, the
above ten variables for a single page are all contained
in this record. This makes it easy to swap data with
other page. This is the data currently being used on the
screen.
Universal Variables - These variables are not specific to any window or
video page and are used universally in the program.
Variable Description
-------------- ---------------------------------------------------------
VirtualRows (Type: byte) This is the row height saved from
SetVirtualSize setting the number of rows used in the
virtual screen. The default is CRTrows.
VirtualCols (Type: byte) This is the column width saved from
SetVirtualSize setting the number of columns used in the
virtual screen. The default is CRTcols.
VirtualSize (Type: word) This is the size in bytes to be reserved
for the virtual screen. The size is VirtualCols *
(VirtualRows+2) * 2. Remember the last two rows are
added for the virtual titles.
MaxValidPage (Type: byte) The program can reserve enough data for all
video pages being address with MaxPageUsed. However, the
machine that runs the program must have those pages
available. This variable additionally limits the pages
that can be addressed which is the lesser of MaxPage or
MaxPageUsed.
ZoomDelay (Type: byte) This value is set by InitWindow to control
the zoom rate on non-snowing video cards. This value is
set according to the CpuID.
AddrGoof (Type: pointer) This points to the ShowGoof procedure in
the Goof unit to display fatal errors.
CrtWI (Type: word) This value saves the last index that is
being used to indicate which window is active on the CRT.
Chapter 3, Data Structure Page 31
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
The value is always CrtWI<=LI and is primarily used to
indicate which window has the cursor.
DYNAMIC VARIABLES
Dynamic Variables - These variables are allocated to the heap to leave more
room for global variables. They are allocated in InitWindow.
Pointer Description
-------------- ---------------------------------------------------------
VirtualStat (Type: ^WndwStatType) This array of window records is
for the virtual screens associated with the virtual
windows. All routines use this data when writing to
virtual screens by copying it to TWS. The index for this
record is obtain from TWS.VI. Since this array is filled
at random, VI does not correspond to WI. When a virtual
window is removed, these stats are "freed" by renaming
WSname to FreeWindow - they are not freed by FreeMem.
All video pages use this one array.
PageStat (Type: ^PageStatRec) If your program uses multiple video
pages, a complete record of all the window records and
indexes are saved for each video page. These can be
easily swapped with TopPageStat to work on the current
video page. The WriteToPage procedure handles this
operation.
Chapter 3, Data Structure Page 32
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
A P P E N D I X A : M E M O R Y A L L O C A T I O N
This section covers the memory requirements for global data in the data
segment and dynamic data in the heap. This will give you the figures on
how to calculate the memory needed for your program.
GLOBAL MEMORY
Global Memory - WNDW is very frugal with global data. Here is the
breakdown on the fixed amount of data required:
Variables Bytes
------------------------------- -----
Border array constants 210
Basic windows 146
Additional for virtual windows 69
Additional for multi-page video 4
-----
Fixed allocation 429
The additional for virtual windows and multi-page video can be deleted with
directives if not used. This is the allocation for MaxWndw=0. For each
additional window record, add 52 bytes. So, for MaxWndw=10, the allocation
would be (52*10)+429=949 bytes.
DYNAMIC MEMORY
Dynamic Variables - To alleviate using global data, dynamic variables are
used for permanent and temporary use. The allocation for virtual screen
records and video page records are permanent throughout the program. Many
other procedures such as MoveWindow temporarily use the heap to perform
operations.
Permanent Variables - If the directives have been defined, the following
allocation can be calculated:
Variables Bytes
--------------- -------------------------------
VirtualStat 52 per virtual window
PageStat (SizeOf(TopPageStat)) per video page
Virtual screen VirtualSize
Virtual screens are kept in memory until RemoveWindow is used.
Temporary Variables - For procedures that temporarily use the heap, the
size of allocation is listed along with each procedure in section 2 above.
Generally, you should allow about the same size as 3 CRT screens of
available Heap for those procedures. For a video mode with 25 rows and 80
columns, this is (80*25*2)*3=12000 bytes. This should be added in addition
to the random allocation.
Random Allocation - Because of the nature of random access to windows and
underlays, the program uses GetMem and FreeMem. This means that there are
Appendix A: Memory Allocation Page 33
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
going to be gaps of free memory in the heap. To account for this, you
should more than double the amount of data expected for underlays and
virtual screens. It is up to you to judge just how must of the heap is
going to be truly random. In the case of simple serial-access to windows,
the heap will be contiguous and doubling of the heap is unnecessary.
CODE SIZE
Code Size - WNDW is also very frugal with with code. Here is the
breakdown for code usage (this may vary slightly):
Code Description Bytes
------------------------------- -----
Basic windows 8912
Additional for virtual windows 3920
Additional for multi-page video 256
-----
Total code 13088
Of course the TP4 smart compiler will optimize the code leaving out unused
procedures. But this gives you a good idea of how small the code really
is!
Appendix A: Memory Allocation Page 34
WNDW Multi-level Virtual Windows Reference Guide, Version 5.5
A P P E N D I X B : E R R O R M E S S A G E S
Because WNDW is so powerful, it writes to screen in memory as well as the
CRT. Should you make a mistake in programming, it may not show up on the
CRT screen. So, to prevent the errors before they happen, programs written
with errors will terminate with an error message window on the CRT to
reveal the problem. The program terminates through the GOOF unit which can
be freely edited.
"Not enough heap space" - The minimum heap size is too small. Increase the
size as required in APPENDIX A.
"Too many windows" - Tried to create more windows than MaxWndw allows.
Either remove windows or increase MaxWndw.
"Too many virtual windows" - Tried to create more virtual windows than
MaxVirtualWndw allows. Either remove windows or increase MaxVirtualWndw.
"Perm window out of order" - Tried to create a PermMode window while a
normal window is the top window. Remove or hide window before making a
permanent window. Routinely, all PermMode windows are created first.
"No window to remove" - Tried to remove the initial window Window0 which is
permanent.
"Hidden window not found" - Tried to write to a hidden window that does not
exist. Check for the correct name.
"Virtual screen not found" - Tried to write to a virtual screen that does
not exist. Check for the correct name.
"Video page not available" - Tried to write to a video page that has not
been allocated or does not exist for the hardware as expected. Be sure to
use MaxValidPage.
Appendix B: Error Messages Page 35