home *** CD-ROM | disk | FTP | other *** search
-
- VIDPOP.DOC 9-24-88
- ---------------------------------------------------------------------
-
- Note: This copy of VIDPOP.TPU was compiled with Turbo Pascal 5.0.
-
-
- VIDPOP.TPU is directed at our customers who also own SAYWHAT?!, the
- language independent screen design system. If you do not currently own
- SAYWHAT?! you will not be able to take advantage of most of the funcions
- contained in VIDPOP.TPU.
-
- VIDPOP.TPU is a subset of the functions available in VIDPOP.COM and a
- replacement for POPSCRN.TPU both of which are part of the SAYWHAT?!
- screen design package.
-
- VIDPOP.TPU has some of the same procedures found in POPSCRN.TPU but with
- simplified syntax and significant enhancements. This document will
- describe each function and procedure and note any differences from
- POPSCRN.TPU.
-
- VIDPOP.TPU provides three methods of displaying SAYWHAT?! screens.
- Screens may be linked in individually, linked in contained in library
- files, or displayed without linking, from library files on disk. Other
- functions available include the ability to save and restore screens in
- memory, compensate for the problem of composite video systems, determine
- video modes, and interrogate the directory of screen library files. Unlike
- VIDPOP.COM and POPSCRN.TPU, it is possible to have up to 10 libraries open
- at one time. Another new feature is the ability to determine if a screen
- was actually displayed from a library as requested.
-
-
- PROCEDURE PopScreen(DataPointer : POINTER);
-
- The simplest way to display screens stored in the SAYWHAT?! .SQZ format
- is to link them into your program. The three step process is as
- follows:
- 1) convert the SQZ file to an OBJ file with BORLAND's
- BINOBJ.EXE program:
- C> BINOBJ myscreen.SQZ myscreen.OBJ myscreen
-
- 2) link in the OBJ file:
- {$L myscreen.obj}
-
- 3) define an external procedure with the same name as specified when
- the OBJ file was created:
- Procedure MyScreen; External;
-
- Whenever you want that screen displayed just add the following
- command to your program:
-
- POPSCREEN(@myscreen);
-
-
- When you have a library of screens you want to display you have three
- options: 1) leave the library(s) on disk and read each screen from the
- library as needed, 2) read the library onto the heap at runtime and
- display screens directly from memory, or 3) link whole libraries in at
- compile time and display screens from them in memory.
-
- Up to ten disk-based screen libraries may be accessed with the
- following four procedures. The parameter "WhichLib" may be any number
- between 1 and 10. To conserve file handles it is recommended that
- the StayOpen parameter of the OpenLibrary() procedure be False. To
- achieve maximum speed of screen display the StayOpen parameter should
- be True, whereby the screen library will not be closed between calls
- to PopLib(). Always use the CloseLibrary() procedure in order to recover
- memory used for the library header, regardless of the value of
- StayOpen when the library was opened.
-
- PROCEDURE OpenLibrary(WhichLib : Byte;
- LibraryName : String;
- StayOpen : Boolean);
-
- Example: OpenLibrary(1,'Screens.Lib', True);
-
- PROCEDURE PopLib(WhichLib : Byte; ScreenName : String8);
- Example: PopLib(1,'MainMenu');
-
- PROCEDURE CloseLibrary(WhichLib : Byte);
- Example: CloseLibrary(1);
-
- FUNCTION LibScreenName(WhichLib, ScreenNo : Byte) : String8;
- Example: ScreenName := LibScreenName(1,counter);
-
-
- The following procedure is all that is needed to display screens
- from libraries stored in memory at runtime or linked in at compile
- time:
-
- PROCEDURE PopLibMem(PtrToLib : Pointer; ScreenName : String8);
- Example: PopLibMem(@mylibrary,'MainMenu');
-
- If you need to interrogate the library directory contents use the
- following function:
-
- FUNCTION MemLibScreenName(PtrToLib : Pointer; number : Byte) : String8;
-
- Example:
- Counter := 1;
- Repeat { display all screens without knowing their names }
- ScreenName := MemLibScreenName(@mylibrary,Counter);
- if Length(screenname) > 0 then PopLibMem(@mylibrary,ScreenName);
- Inc(Counter);
- Until (Length(ScreenName) = 0) or (Counter > 100);
-
-
- Now it is possible to control the display position of "sub-screens"
- at run-time by calling the following procedure before calling any of
- the above display routines to pop a sub-screen. The column and row
- parameters should correspond to the position that you wish the upper
- left corner of the sub-screen to appear. The coordinates you specify
- will be used regardless of the position of the sub-screen when
- originally saved with SAYWHAT?! Set_Position_To() will have no effect
- on full size screens. { Please note that these column and row values
- will not be affected by the Set_Coordinates_To procedure in
- SAYGET4.TPU}
-
- PROCEDURE Set_Position_To(col,row : Byte);
-
- Example: Repeat
- Set_Position_To(Random(79),Random(24));
- PopScreen(@subscreen);
- Until forever;
-
-
- PROCEDURE FillPage(PagePtr : Pointer);
- FillPage will make a copy of the current screen to any buffer
- specified by the pointer specified. It is up to you to make sure
- that the buffer pointed to is of sufficient size to hold an entire
- screen. 4000 bytes is slightly more than enough and easy to remember.
- You may have as many screen buffers as you wish and PagePtr may also
- point to the hardware video buffers (pages) if available.
- Example:
- VAR buffer : array[1..4000] of byte;
- begin
- FillPage(@buffer);
- ....
- DisplayPage(@buffer);
- end.
-
- PROCEDURE DisplayPage(PagePtr : Pointer);
- Companion to FillPage(), displays a screen previously stored in buffer
- at PagePtr. No checking is done to determine if any image was in fact
- stored at this location in memory.
-
- PROCEDURE Set_BW_On;
- When SAYWHAT?! screens designed for color systems, are displayed on
- composite monitors it is often best to turn off the color by calling
- this procedure once in your program. Once called, all color
- information will be converted to black and white which will be
- properly visible on a composite monitor.
-
- PROCEDURE Set_BW_Off;
- Resets display routines to default state where SAYWHAT?! images
- created and saved in color will be displayed in color.
-
- PROCEDURE Set_Status_Top;
- Causes screens to be displayed with room for a status line at row 1.
- This is the default setting.
-
- PROCEDURE Set_Status_Bottom;
- Causes screens to be displayed with room for a status line at row 25.
-
- PROCEDURE Set_SnowProtection_On;
- Screens will be displayed with snowless routines if the current
- monitor is a CGA.
-
- PROCEDURE Set_SnowProtection_Off;
- Screens will be displayed without regard for snow even if the current
- monitor is a CGA.
-
- FUNCTION AbsWhereX : Byte; { returns cursor position regardless of windows }
- Returns the absolute column position of the cursor regardless if any
- Turbo Pascal windows are active.
-
- FUNCTION AbsWhereY : Byte;
- Returns the absolute row position of the cursor regardless if any
- Turbo Pascal windows are active.
-
- FUNCTION VideoMode : Byte;
- Returns the numeric value of the current video mode as determined by
- DOS.
-
- FUNCTION GraphicsMode : Boolean;
- Returns True if the current video mode is one of the various graphics
- modes.
-