home *** CD-ROM | disk | FTP | other *** search
- Text Windowing Interface (TWI) v1.1 Procedure List For All Units
- TWI (C) David Pabst 1992 All Rights Reserved
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-
- This file probably will not be able to be printed on your printer without
- text to roll on to the next line. This is known and was done purposely,
- since this file is basically designed to be an "online" reference.
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-
- TWI.TPU - TWI.TPU is the first variation of TWI. The difference between
- this variation and TWI2.TPU is that in TWI.TPU you have to pass the
- environment (colors, etc...) through the procedures. In TWI2.TPU,
- there are global variables BUILT IN to the unit itself, so you don't
- have to pass variables all the time.
-
- TWI2.TPU - Variation 2 of TWI. Var. 2 uses global variables that are
- built into TWI2.TPU itself. Also, MENUS.TPU is built into TWI2.TPU.
-
- MENUS.TPU - A full pull down menuing unit with procedures for sub menus
- and more! MENUS.TPU is built into TWI2.TPU, and CAN ONLY BE USED WITH
- TWI.TPU.
-
- Remember: Registering gets you the source code to all three units so
- that you can fully customize TWI for your uses!
-
- Procedure and Global Variables For TWI.TPU
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
- Interface
-
- Var
- YourName : String; (* Enter your name into this var when reg'd *)
- YourCode : LongInt; (* Your registration code when you register *)
-
- (***************************************************)
- (*** IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! ***)
- (***************************************************)
- (*** FGC,BGC,FCCF,FCCB,LC,WCOL,X,Y are Integers! ***)
- (*** FGC,BGC,FCCF,FCCB,LC,WCOL are colors ***)
- (*** X and Y are cooridinates ***)
- (*** A,B,C,D,E,F,G,etc... LineA... are strings ***)
- (*** and are displayed in the windows you draw ***)
- (***************************************************)
-
-
- (**** The Following Procedure Set The Interface Up ****)
-
- procedure DrawBackGround(StatusLineTop,StatusLineBottom: string; fillchar: char; fccf,fccb,wcol: integer);
- (* Draws the background of the interface, allows for full control *)
- (* Refer: QuickBKGDraw *)
- (* Example: DrawBackGround(Top,Bottom,'▒',7,1,4);
-
- Procedure QuickBKGDraw(Top,Bottom: String);
- (* Use instead of DrawBackground for very easy and fast Background draws *)
- (* QUICKBKGDRAW uses hard coded "defaults" for colors and characters *)
- (* All you have to enter is the top and bottom status lines *)
- (* Refer: DrawBackGround; *)
- (* Example: QuickBKGDraw(TheTopStatusLine,'The Bottom Status Line');
-
- Procedure ChangeBottomLine(Bottom: string; color : integer);
- (* Changes the status line on the bottom of the screen *)
- (* Refer: ChangeStatusLine; *)
- (* Example: ChangeBottomLine(OnTheBottomLine,4);
-
- procedure ChangeStatusLine(Top,StatusLine:string; fccf,fccb,wcol : integer);
- (* Changes the Top and Bottom Status Lines *)
- (* Refer: ChangeBottomLine *)
- (* Example: ChangeStatusLine(Top,Bottom,1,7,2); *)
-
- procedure TwiClose;
- (* Shuts TWI totally down, cleans up screen, and terminates program *)
- (* execution *)
-
- (**** The following procedures are misc. commands that are included fo your
- benefit ****)
-
- Procedure WaitForReturn;
- (* Waits for the user to press return *)
-
- Procedure WriteXYi(x,y,text : integer);
- (* Writes an integer to any X,Y cooridinate on the screen *)
- (* Example: WriteXYI(4,4,4); *)
-
- Procedure WriteXY(X,Y: Integer; Text: String);
- (* Writes a string to any X,Y cooridinate on the screen *)
- (* Example: WriteXY(4,4,'Do you like TWI?'); *)
-
- Procedure DrawOneLineWindow(a: string;fgc,bgc,lc,x,y:integer);
- (* Draws a window that is one line in height *)
- (* Example: DrawOnelIneWindow(LineToDisplay,FGC,BGC,LC,3,3); *)
-
- Procedure DrawFullWindowOutline (FGC,BGC,LC : Integer );
- (* Draws a box that occupies the whole screen *)
- (* Example: DrawFullWindowOutline (1,2,3); *)
-
- procedure TwiFileLoad(FileName,HelpTitle: string; fgc,bgc,lc: integer);
- (* Draws a window, and loads a file 10 lines long and 40 chars wide *)
- (* The procedure also puts a title of the window on it *)
- (* Example: TWIFileLoad('TWIDEMO.HLP','Help',1,7,3); *)
-
- procedure DrawSmallWindow(a,b,c,d : string; fgc,bgc,lc,x,y : integer);
- (* Draws a small four line window. *)
- (* Example: DrawSmallWindow(LineA,'Line 2',LineC,'Line 4',fgc,Bgc,Lc,25,8); *)
-
- procedure DrawMediumWindow(a,b,c,d,e,f : string; fgc,bgc,lc,x,y: integer);
- (* Draws a window 6 lines long and about 40 characters wide *)
- (* Refer: ClearMediumWindow *)
- (* Example: DrawMediumWindow(A,B,C,D,E,F,1,2,3,4,5); *)
-
- procedure DrawLargeWindow(a,b,c,d,e,f,g,h,i,j : string; fgc,bgc,lc,x,y: integer);
- (* Draws a 10 line window. *)
- (* Refer: ClearLargeWindow *)
- (* Example: DrawLargeWindow('Line 1',B,C,D,E,F,G,H,I,J,FGC,2,1,2,3); *)
-
- procedure DrawColorBox(x,y,fgc,bgc,lc: integer);
- (* Draws a box that contains all possible combinations of colors available *)
- (* This can be displayed, and used to have users customize their use *)
- (* of TWI. You have to write the actual input procedure, though *)
- (* Example: DrawColorBox(4,4,FGC,BGC,LC); *)
-
- procedure DrawVeryBigWindow(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o: string; fgc,bgc,lc,x,y: integer);
- (* This is the biggest window available right now in TWI. It is 15 lines *)
- (* and very wide. *)
- (* Refer: ClearVeryBigWindow *)
- (* Example: DrawVeryBigWindow(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,1,2,3,4,5); *)
-
- Procedure WriteDosError(Error,FGC,BGC,lC,FCCF,FCCB : Integer);
- (* Displays, in a window, the DOS error returned to pascal in *)
- (* DOSERROR after using EXEC,etc... It Displays the error and the problem *)
- (* Example: WriteDosError(DOSERROR,1,2,3,1,2); *)
-
- (**** The following procedures clear the different types of windows and
- boxes from the screen ****)
-
- procedure ClearSmallWindow(x,y,fccf,fccb:integer);
- (* Removes a small window from the screen *)
- (* Refer: DrawSmallWindow *)
- (* Example: ClearSmallWindow(25,8,FCCF,FCCB); *)
-
- procedure ClearMediumWindow(x,y,fccf,fccb:integer);
- (* Removes a medium window from the screen *)
- (* Refer: DrawSmallWindow *)
- (* Example: ClearMediumWindow(4,5,1,2); *)
-
- procedure ClearLargeWindow(x,y,fccf,fccb : integer);
- (* Removes a Large Window from the screen *)
- (* Refer: DrawLargeWindow *)
- (* Example: ClearLargeWindow(3,3,2,2); *)
-
- procedure ClearVeryBigWindow(x,y,fccf,fccb: integer);
- (* This removes a VeryBigWindow from the screen *)
- (* Refer: DrawVeryBigWindow *)
- (* Example: ClearVeryBigWindow(4,5,1,2); *)
-
- Procedures and Global Variables For TWI2.TPU
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- interface
- var
- Fillchar : char; (* Fill in chacarter for background *)
- YourName : String; (* Enter your name when you register *)
- YourCode : LongInt; (* Code you receive from me *)
- MenuA,Menub,MenuC,Menud,MenuE,MenuF,MENUG : String[10]; (* Submenus *)
- Hfc, Hbc, Hc, Fccf, Fccb, Wcol, Fgc, Bgc, Lc : integer; (* Colors *)
-
- { TWI allows you to pass information in the form of variables through
- your program to this unit. Descriptions:
-
- - * FILLCHAR is a CHARacter - this is the character that is used
- to fill the background of the screen. Usually it is ▒
- * Yourname is a STRING - in your software type YOURNAME :=
- whateveryournameis. T
- * YourCode is a LONGINT - in your software type YOURCODE :=
- thecodeigaveyou. BOTH THIS AND YOURNAME MUST BE ENTERED
- IN YOUR SOFTWARE PROGRAM; THIS WILL DISABLE ALL BUG-A-BOO
- SCREENS!
- * MenuA...MenuG are the pull down menu titles, these are the ones
- that are are on top of the screen, and that signify a menu is
- underneath them. What I mean is, look at your TP6 editor, the
- menu options on the top of the screen.
- * Colors: HFC - Highlight ForeGroundColor for pull down menus
- * Colors: HBC - Hughlight BackgroundColor for pull down menus
- - * Colors: HC - Highlight Color
- - * Colors: FCCF - Foreground for Fill Character
- - * Colors: FCCB - Background for Fill Character
- - * Colors: WCol - Word Color - The color the words in the status lines
- are.
- - * Colors: FGC - Foreground Color
- - * Colors: BGC - Background Color
- - * Colors: Lc - Line Color
-
- Items with the dash before them have to be intialized within your program
- to have it work properly. If you use the pull down menu procedures you
- have to do all the other ones.
-
- YOURNAME and YOURCODE don't have to be initialized until you regiter
- TWI. }
-
- (***************************************************)
- (*** IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! ***)
- (***************************************************)
- (*** FGC,BGC,FCCF,FCCB,LC,WCOL,X,Y are Integers! ***)
- (*** FGC,BGC,FCCF,FCCB,LC,WCOL are colors ***)
- (*** X and Y are cooridinates ***)
- (*** A,B,C,D,E,F,G,etc... LineA... are strings ***)
- (*** and are displayed in the windows you draw ***)
- (***************************************************)
-
-
- (**** The Following Procedure Set The Interface Up ****)
-
- procedure DrawBackGround(StatusLineTop,StatusLineBottom: string);
- (* Draws the background of the interface, allows for full control *)
- (* Refer: QuickBKGDraw *)
- (* Example: DrawBackGround(Top,Bottom);
-
- Procedure QuickBKGDraw(Top, Bottom : String);
- (* Use instead of DrawBackground for very easy and fast Background draws *)
- (* QUICKBKGDRAW uses hard coded "defaults" for colors and characters *)
- (* All you have to enter is the top and bottom status lines *)
- (* The difference is: You don't have to set the colors before you set the *)
- (* background up *)
- (* Refer: DrawBackGround; *)
- (* Example: QuickBKGDraw(TheTopStatusLine,'The Bottom Status Line');
-
- procedure ChangeStatusLine(Top,StatusLine:string);
- (* Changes the Top and Bottom Status Lines *)
- (* Refer: ChangeBottomLine *)
- (* Example: ChangeStatusLine(Top,Bottom); *)
-
- procedure ChangeBottomLine(Bottom: string; color : integer);
- (* Changes the status line on the bottom of the screen *)
- (* Refer: ChangeStatusLine; *)
- (* Example: ChangeBottomLine(OnTheBottomLine,4);
-
- procedure TwiClose;
- (* Shuts TWI totally down, cleans up screen, and terminates program *)
- (* execution *)
-
- (**** The following procedures are misc. commands that are included fo your
- benefit ****)
-
- procedure DefaultColors;
- (* Call this if you don't want to set the colors up *)
- (* This contains the standard color defaults *)
- (* Refer: QuickBKGDraw, DrawBackGround *)
-
- procedure WaitForReturn;
- (* Waits for the user to press return *)
-
- Procedure WriteXYi(x,y,text : integer);
- (* Writes an integer to any X,Y cooridinate on the screen *)
- (* Example: WriteXYI(4,4,4); *)
-
- Procedure WriteXY(x,y : integer; text : string);
- (* Writes a string to any X,Y cooridinate on the screen *)
- (* Example: WriteXY(4,4,'Do you like TWI?'); *)
-
- (**** Pull Down Menu Procedures ****)
-
- Procedure DrawMenus;
- (* Draws the menu bar at the top of the screen *)
- (* YOU MUST INTIALIZE MENUA...MENUG FOR IT WORK *)
-
- Procedure MoveToLocal(MoveToplace : integer);
- (* Moves you to one of the options on the menu bar *)
- (* Refer: CleanOldLocation *)
- (* Example: MoveToLocal(1); Would move you to MENUA *)
-
- Procedure CleanOldLocation(oldLocation:integer);
- (* Removes the cursor placed by MOVETOLOCAL *)
- (* Refer: MoveToLocal *)
- (* Example: CleanOldLocation(1); Would take the highlighted cursor off of
- MENUA that was pot by MOVETOLOCAL *)
-
- Procedure DrawSubMenu(Suba,Subb,Subc,Subd,Sube,Subf,Subg,Subh: string; x,y,lgth: integer);
- (* Draws a sub menu of up to 8 options; SUBA..SUBH are the options *)
- (* X,Y is the position of the submenu. LGTH is the length of the submenu *)
- (* Refer: WhereCursorIsReWrite, OldPlaceRewrite *)
- (* Example: DrawSubMenu(SubA,SubB,SubC,SubD,SubE,SubF,SubG,SubH,1,2,8);
-
- Procedure WhereCursorIsReWrite(Placex,Placey : integer; option : string);
- (* Though the procedure's name is strange, this basically writes over *)
- (* an option on the screen to make it look like it is highlighted *)
- (* Refer: DrawSubMenu, OldPlaceRewrite *)
- (* Example: WhereCursorIsRewrite(3,3,SUBA); *)
-
- Procedure OldPlaceReWrite(Placex,Placey: integer; option: string);
- (* Goes back over where "WHERECURSORISREWRITE" and changes the option *)
- (* in the submenu back to being normal, not highlighted *)
- (* Refer: DrawSubMenu, WhereCursorIsRewrite *)
-
- (**** The following procedure draw different types of boxes and windows on
- the screen. ****)
-
- procedure DrawOneLineWindow(A: String;x,y : integer);
- (* Draws a window that is one line in height *)
- (* Example: DrawOnelIneWindow(LineToDisplay,3,3); *)
-
- Procedure DrawFullWindowOutline;
- (* Draws a complete window that takes up 23 lines of the screen *)
-
- procedure TwiFileLoad(FileName,HelpTitle: string);
- (* Draws a window, and loads a file 10 lines long and 40 chars wide *)
- (* The procedure also puts a title of the window on it *)
- (* Example: TWIFileLoad('TWIDEMO.HLP','Help'); *)
-
- procedure DrawSmallWindow(a,b,c,d : string; x,y : integer);
- (* Draws a small four line window. *)
- (* Example: DrawSmallWindow(LineA,'Line 2',LineC,'Line 4',25,8); *)
-
- procedure DrawMediumWindow(a,b,c,d,e,f : string; x,y : integer );
- (* Draws a window 6 lines long and about 40 characters wide *)
- (* Refer: ClearMediumWindow *)
- (* Example: DrawMediumWindow(A,B,C,D,E,F,4,5); *)
-
- procedure DrawLargeWindow(a,b,c,d,e,f,g,h,i,j : string; x,y : integer);
- (* Draws a 10 line window. *)
- (* Refer: ClearLargeWindow *)
- (* Example: DrawLargeWindow('Line 1',B,C,D,E,F,G,H,I,J,2,3); *)
-
- procedure DrawColorBox(x,y: integer);
- (* Draws a box that contains all possible combinations of colors available *)
- (* This can be displayed, and used to have users customize their use *)
- (* of TWI. You have to write the actual input procedure, though *)
- (* Example: DrawColorBox(4,4); *)
-
- procedure DrawVeryBigWindow(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o: string; x,y: integer);
- (* This is the biggest window available right now in TWI. It is 15 lines *)
- (* and very wide. *)
- (* Refer: ClearVeryBigWindow *)
- (* Example: DrawVeryBigWindow(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,4,5); *)
-
- Procedure WriteDosError(Error : Integer);
- (* Displays, in a window, the DOS error returned to pascal in *)
- (* DOSERROR after using EXEC,etc... It Displays the error and the problem *)
- (* Example: WriteDosError(DOSERROR); *)
-
- (**** The following procedures clear the different types of windows and
- boxes from the screen ****)
-
- procedure ClearSmallWindow(x,y:integer);
- (* Removes a small window from the screen *)
- (* Refer: DrawSmallWindow *)
- (* Example: ClearSmallWindow(25,8,FCCF,FCCB); *)
-
- procedure ClearMediumWindow(x,y:integer);
- (* Removes a medium window from the screen *)
- (* Refer: DrawSmallWindow *)
- (* Example: ClearMediumWindow(4,5); *)
-
-
- procedure ClearLargeWindow(x,y : integer);
- (* Removes a Large Window from the screen *)
- (* Refer: DrawLargeWindow *)
- (* Example: ClearLargeWindow(2,3); *)
-
-
- procedure ClearVeryBigWindow(x,y: integer);
- (* This removes a VeryBigWindow from the screen *)
- (* Refer: DrawVeryBigWindow *)
- (* Example: ClearVeryBigWindow(4,5); *)
-
- Procedures and Global Variables for MENUS.TPU
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Interface
- Uses Crt;
- Var
- MenuA,Menub,MenuC,Menud,MenuE,MenuF,MENUG : String[10];
- Hfc, Hbc, Hc, Lc, Fgc, BGC : Integer;
- (**************************************************************************
- ** HFC - Highlight Foreground Color ** HBC - Highlight Background Color **
- ** HC - Highlight Color ** LC - Line Color **
- ** FGC - Foreground Color ** BGC - Background Color **
- **************************************************************************
- ** Menua..menug are the options on the menu bar at the top of the screen**
- **************************************************************************)
-
-
- Procedure DrawMenus;
- (* Draws the menu bar at the top of the screen *)
- (* YOU MUST INTIALIZE MENUA...MENUG FOR IT WORK *)
-
- Procedure MoveToLocal(MoveToplace : integer);
- (* Moves you to one of the options on the menu bar *)
- (* Refer: CleanOldLocation *)
- (* Example: MoveToLocal(1); Would move you to MENUA *)
-
- Procedure CleanOldLocation(var oldLocation:integer);
- (* Removes the cursor placed by MOVETOLOCAL *)
- (* Refer: MoveToLocal *)
- (* Example: CleanOldLocation(1); Would take the highlighted cursor off of
- MENUA that was pot by MOVETOLOCAL *)
-
- Procedure DrawSubMenu(var Suba,Subb,Subc,Subd,Sube,Subf,Subg,Subh: string; x,y,lgth: integer);
- (* Draws a sub menu of up to 8 options; SUBA..SUBH are the options *)
- (* X,Y is the position of the submenu. LGTH is the length of the submenu *)
- (* Refer: WhereCursorIsReWrite, OldPlaceRewrite *)
- (* Example: DrawSubMenu(SubA,SubB,SubC,SubD,SubE,SubF,SubG,SubH,1,2,8);
-
- Procedure WhereCursorIsReWrite(Placex,Placey : integer; option : string);
- (* Though the procedure's name is strange, this basically writes over *)
- (* an option on the screen to make it look like it is highlighted *)
- (* Refer: DrawSubMenu, OldPlaceRewrite *)
- (* Example: WhereCursorIsRewrite(3,3,SUBA); *)
-
- Procedure OldPlaceReWrite(Placex,Placey: integer; option: string);
- (* Goes back over where "WHERECURSORISREWRITE" and changes the option *)
- (* in the submenu back to being normal, not highlighted *)
- (* Refer: DrawSubMenu, WhereCursorIsRewrite *)
-
-