TW200 COPYRIGHT (C) 1990 RICHARD D. FOTHERGILL MULTI-LEVEL WINDOWS, MENUS AND UTILITIES for Turbo Pascal Version 5.X FILES on your disk: TW200d.TPU - Turbo Pascal window unit file TD200.PAS - Demonstration program source code TD200.EXE - Compiled demonstration program WARRANTY AND DISCLAIMER The author makes no warranties, expressed or implied, as to the quality or performance of this program. The author will not be held liable for any direct, indirect, incidental or consequential damages resulting from the use of this program. Your use of the program constitutes your agreement to this disclaimer and your release of the author from any form of liability or litigation. Any brand or product names are trademarks or registered trademarks of their respective holders. This is a demonstration file for evaluation only. Some features are not available and the maximum windows has been limited to three. This document file is a condensed version to give you a description of the statements and function you will have available in the registered version. You can order the registered version, which includes a printed manual, by sending $25.00 ($30.00 for 3-1/2" disk) plus $1.50 for shipping and handling to: Richard Fothergill 141 Oak Hill Road Pittsfield, MA 01201 Support for TW200 will be available to registered uses online through: GEnie - R.FOTHERGILL CServ - 76210,443 the Oak Hill BBS (413) 499-7245 -------------------------------------------------------------------- ATTR function -------------------------------------------------------------------- Purpose Calculate the color attribute given the foreground and background colors. Returns an integer value. Syntax txtattr := Attr(fg,bg) -------------------------------------------------------------------- CALCULATOR procedure -------------------------------------------------------------------- Purpose Presents a four function with memory calculator in a pop-up window. Syntax Calculator(row,col,wattr,shdw) -------------------------------------------------------------------- CLOSEWIN procedure -------------------------------------------------------------------- Purpose To remove the last window opened from the screen, restore the area under the window and restore the cursor position. Syntax Closewin -------------------------------------------------------------------- CURDIR function -------------------------------------------------------------------- Purpose Returns a string representing the DOS current directory in the form of Drive:\Dir\ Syntax cdir := Curdir -------------------------------------------------------------------- CURDISPLAY function -------------------------------------------------------------------- Purpose Returns an integer value representing the type of the active monitor. 0 - MONO 3 - MCGA 1 - CGA 4 - VGA 2 - EGA Syntax vidtype := Curdisplay -------------------------------------------------------------------- CURDRIVE function -------------------------------------------------------------------- Purpose Returns a string representing the DOS current drive in the form of drive letter followed by a colon. Syntax cd := Curdrive ------------------------------------------------------------------- CURSOROFF procedure ------------------------------------------------------------------- Purpose Turns the cursor off. Syntax Cursoroff ------------------------------------------------------------------- CURSORON procedure ------------------------------------------------------------------- Purpose Turns the cursor on. Syntax Cursoron -------------------------------------------------------------------- FALIGN function -------------------------------------------------------------------- Purpose Formats a file name string to its full width of eight for the filename and three for the extension. Any missing characters are padded with spaces to form the string. Syntax filname := Falign(filspec) -------------------------------------------------------------------- FAKEWIN procedure -------------------------------------------------------------------- Purpose Draws a box on the screen. No screen saving performed. Syntax Fakewin(row,col,rows,cols,wattr,battr,brdr,sattr,shdw,zoom) -------------------------------------------------------------------- FEXISTS function -------------------------------------------------------------------- Purpose Boolean function indicating whether the file specified exists in the path and file spec given. Syntax filexists := Fexists(fspec) -------------------------------------------------------------------- GETFIELD procedure -------------------------------------------------------------------- Purpose Provide a formatted data input field. Syntax Getfield(row,col,ans,dtype,size,dec,lstkey,inattr,outattr) -------------------------------------------------------------------- GETKEY procedure -------------------------------------------------------------------- Purpose Get a key stroke from the keyboard. Returns CH1 = to ASCII code if it is a printable character and CH2 = #0. If an extended key is pressed returns CH1 = #0 and CH2 = extended key code. Syntax Getkey(ch1,ch2) -------------------------------------------------------------------- GETREC procedure -------------------------------------------------------------------- Purpose Presents multiple fields for edited data input based on information provided in the descriptor array. Allows movement from field to field and action to be taken can be determined by the last key pressed. Syntax Getrec(Info,Datarr,Trecs,Lstkey,Doedit,Inattr,Outattr) -------------------------------------------------------------------- MAKEFMENU function -------------------------------------------------------------------- Purpose Presents a pop-up menu of a directory of files matching the specification and attribute given from which a selection can be made. Returns, in a pathstr type, the file selected or a null string if Esc is pressed. Syntax pikfil := Makefmenu(fspec,row,col,rows,wattr,battr,sattr, shdw,zoom,hlattr) -------------------------------------------------------------------- MAKEHMENU procedure -------------------------------------------------------------------- Purpose Presents a horizontal menu within a previously open window. Returns an integer value which indicates the selection made. Syntax Makehmenu(hmenurec) -------------------------------------------------------------------- MAKELMENU function -------------------------------------------------------------------- Purpose Presents a vertical list within a previously open window. Returns a word value which indicates the selection made. The list can be longer than the window with the direction keys controlling movement. Syntax Makelmenu(recarr,recs,startpos,hlattr) -------------------------------------------------------------------- MAKEVMENU procedure -------------------------------------------------------------------- Purpose Presents a vertical menu within a previously open window. Returns an integer value which indicates the selection made. Syntax Makevmenu(vmenurec) -------------------------------------------------------------------- MAXMEM function -------------------------------------------------------------------- Purpose Returns a long integer representing the total conventional memory in the machine. Syntax maxbytes := Maxmem -------------------------------------------------------------------- OPENWIN procedure -------------------------------------------------------------------- Purpose Open a text window on the screen with automatic screen saving. Syntax Openwin(row,col,rows,cols,wattr,battr,brdr,sattr,shdw,zoom) -------------------------------------------------------------------- POWEROF function -------------------------------------------------------------------- Purpose Returns a real number raised to a power. Syntax num := Powerof(realnum,power) -------------------------------------------------------------------- PRINTCWIN procedure -------------------------------------------------------------------- Purpose Display text centered in the window on the ROW specified using the current attributes and window coordinates. Syntax Printcwin(row,strdat) -------------------------------------------------------------------- PRINTWIN procedure -------------------------------------------------------------------- Purpose Display text in the current window using the current attributes and window coordinates. Syntax Printwin(row,col,strdat) -------------------------------------------------------------------- PRTEST function -------------------------------------------------------------------- Purpose Boolean function indicating the status of the printer port specified (either 1 or 2). Syntax prtok := Prtest(1) -------------------------------------------------------------------- SCOLOR procedure -------------------------------------------------------------------- Purpose To change the color attributes of a specified area of the screen. Syntax Scolor(row,col,rows,cols,attr) -------------------------------------------------------------------- SCROLLWIN procedure -------------------------------------------------------------------- Purpose Scroll the current window either up or down one line. Syntax Scrollwin(dir) -------------------------------------------------------------------- SFILL procedure -------------------------------------------------------------------- Purpose Fills a specified area of the screen with a specified character and color attribute. Syntax Sfill(row,col,rows,cols,char,attr) -------------------------------------------------------------------- SPRINT procedure -------------------------------------------------------------------- Purpose Displays string data at a specified location with a specified color attribute. Syntax Sprint(row,col,strdat,attr) -------------------------------------------------------------------- SPRINTC procedure -------------------------------------------------------------------- Purpose Displays string data centered within specified columns and on a specified row with a specified color attribute. Syntax Sprintc(row,coll,colr,strdat,attr) -------------------------------------------------------------------- STRINGOF function -------------------------------------------------------------------- Purpose Returns a string of a specified length of a specified character. Syntax charstr := Stringof(los,filchar) -------------------------------------------------------------------- TITLEWIN procedure -------------------------------------------------------------------- Purpose To print a title in the border of a window using the color attribute specified at a specified location. Syntax Titlewin(loc,attr,strdat)