                             ADVBAS Windowing Routines

                                      01/12/87

                                by Thomas Hanlin III
                          based on routines by Dave Evers




     One of the functions that I have frequently been asked to include in
ADVBAS is a pop-up window generator.  I've managed to put this off for
quite a while.  Since I've added mouse support to ADVBAS, though, it seems
only right to add windows as well.  MAKEWINDOW is an interim step in that
direction.

     Unlike other ADVBAS functions, MAKEWINDOW is written in BASIC.  This
means that you will have to do a little additional preparation before
using the routine.  The file WINDOW.SUB must be compiled using your BASIC
compiler.  The resulting object code may be linked directly to your prog-
ram using a syntax like "LINK MYPROG+WINDOW,,,ADVBAS".  WINDOW gets added
onto the program you compile (here MYPROG) when you answer "MYPROG+WINDOW"
as the program to link.  ADVBAS must be specified as the library, or as
one of the libraries if you use several of them.

     You can also include the WINDOW.OBJ file you have created in your own
custom library.  See the READ.ME file on how to create your own libraries.
This will also enable you to use the QuickBASIC 2.0 programming environ-
ment.

     So much for technical details.  In the future, MAKEWINDOW will be an
assembly-language routine like all other ADVBAS routines, and you won't
have to go through all this.  The assembly version will be faster, too.
The calling syntax will remain the same, however, so that programs
developed using the current MAKEWINDOW will run even better when the new
version comes out.





Name: MAKEWINDOW

Type: Video / CLONE

Description:
     Creates a pop-up window on the screen.  You specify the window by
giving the upper left corner and lower right corner of the inside of the
window.  The frame is drawn -outside- the window you've specified, so be
sure to allow room for the frame!  For normal windows, the frame takes up
only one column or row.  For shadowed windows, the frame will instead take
up three columns on the left and three rows on the bottom.

     Windows come in four types:
 0, Normal:   the window pops onto the screen.
 1, Growing:  the window "grows" from a spot to a full-sized window.
 2, Shadowed: the window is shadowed on the left and bottom to give a 3D
              effect.
 3, Growing/Shadowed: the window is shadowed and grows.

     You may also choose five types of frames:
 0, None: composed of spaces.
 1, Line: composed of a single line.
 2, Double: composed of a double line.
 3, Double/Single: composed of a double vertical line and a single
                   horizontal line.
 4, Single/Double: composed of a single vertical line and a double
                   horizontal line.

     A label is optional.  If you give one, it is bracketed within the top
of the frame, on the left side.

     You must also select foreground and background colors.  If you are
using a color/graphics adapter, you can select a screen page as well.  In
normal use, you should set the page to zero.

Example:
     LCOL=5:  TROW=5:  REM  top left corner
     RCOL=79: BROW=20: REM  bottom right corner
     LABEL$="Test Window"
     FORE=7: BACK=0:   REM  color/attributes
     PAGE=0:           REM  screen display page
     FRAME=1:          REM  single-line frame
     TYPE=3:           REM  growing, shadowed window
     CALL MAKEWINDOW(LCOL,TROW,RCOL,BROW,LABEL$,FRAME,TYPE,FORE,BACK,PAGE)





Conversion Notes:

     If you are currently using the MAKEWIND routine from Mr. Evers'
BASWIND, you may want to convert to the ADVBAS MAKEWINDOW routine.  The
ADVBAS version has a number of advantages: it is much faster, even in the
current BASIC version; it allows use of screen paging with color adapters;
it allows you to grow shadowed windows; and it will be converted to
assembly language by and by, which will make the displays even smoother.

     MAKEWIND, from BASWIND, uses the following format:
CALL MAKEWIND(TROW,LCOL,BROW,RCOL,FRAME,FORE,BACK,GROW,SHADOW,LABEL$)

     Note that ADVBAS uses the algebraic format for screen coordinates.
BASWIND does the reverse, so you will have to switch from (ROW,COLUMN) to
(COLUMN,ROW).  FRAME, FORE, BACK, and LABEL$ are the same in both
routines, although in different locations.  GROW and SHADOW have been
combined in ADVBAS into TYPE.  Note that if you try to grow shadowed
windows with BASWIND, you will get a normal (no shadow) growing window.
This is not true of ADVBAS, which allows growing shadowed windows.




     Between GETSCREEN, PUTSCREEN, MAKEWINDOW, and the mouse functions, it
should be possible to put together a pretty slick user interface.  If you
do anything on that line, I'd like to hear from you.
