home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / VIDPOP5.ZIP / VIDPOP.DOC next >
Encoding:
Text File  |  1988-09-24  |  7.8 KB  |  189 lines

  1.  
  2.                          VIDPOP.DOC   9-24-88
  3.   ---------------------------------------------------------------------
  4.  
  5.   Note: This copy of VIDPOP.TPU was compiled with Turbo Pascal 5.0.
  6.  
  7.  
  8.   VIDPOP.TPU is directed at our customers who also own SAYWHAT?!, the
  9. language independent screen design system.   If you do not currently own
  10. SAYWHAT?! you will not be able to take advantage of most of the funcions
  11. contained in VIDPOP.TPU.
  12.  
  13.   VIDPOP.TPU is a subset of the functions available in VIDPOP.COM and a
  14. replacement for POPSCRN.TPU both of which are part of the SAYWHAT?!
  15. screen design package.
  16.  
  17.   VIDPOP.TPU has some of the same procedures found in POPSCRN.TPU but with
  18. simplified syntax and significant enhancements.  This document will
  19. describe each function and procedure and note any differences from
  20. POPSCRN.TPU.
  21.  
  22.   VIDPOP.TPU provides three methods of displaying SAYWHAT?! screens.
  23. Screens may be linked in individually, linked in contained in library
  24. files, or displayed without linking, from library files on disk.  Other
  25. functions available include the ability to save and restore screens in
  26. memory, compensate for the problem of composite video systems, determine
  27. video modes, and interrogate the directory of screen library files. Unlike
  28. VIDPOP.COM and POPSCRN.TPU, it is possible to have up to 10 libraries open
  29. at one time.  Another new feature is the ability to determine if a screen
  30. was actually displayed from a library as requested.
  31.  
  32.  
  33.   PROCEDURE PopScreen(DataPointer : POINTER);
  34.  
  35.   The simplest way to display screens stored in the SAYWHAT?! .SQZ format
  36.   is to link them into your program.  The three step process is as
  37.   follows:
  38.      1) convert the SQZ file to an OBJ file with BORLAND's
  39.        BINOBJ.EXE program:
  40.              C> BINOBJ myscreen.SQZ myscreen.OBJ myscreen
  41.  
  42.      2) link in the OBJ file:
  43.              {$L myscreen.obj}
  44.  
  45.      3) define an external procedure with the same name as specified when
  46.         the OBJ file was created:
  47.              Procedure MyScreen; External;
  48.  
  49.      Whenever you want that screen displayed just add the following
  50.      command to your program:
  51.  
  52.              POPSCREEN(@myscreen);
  53.  
  54.  
  55.      When you have a library of screens you want to display you have three
  56.      options:  1) leave the library(s) on disk and read each screen from the
  57.      library as needed, 2) read the library onto the heap at runtime and
  58.      display screens directly from memory, or 3) link whole libraries in at
  59.      compile time and display screens from them in memory.
  60.  
  61.      Up to ten disk-based screen libraries may be accessed with the
  62.      following four procedures. The parameter "WhichLib" may be any number
  63.      between 1 and 10.  To conserve file handles it is recommended that
  64.      the StayOpen parameter of the OpenLibrary() procedure be False.  To
  65.      achieve maximum speed of screen display the StayOpen parameter should
  66.      be True, whereby the screen library will not be closed between calls
  67.      to PopLib().  Always use the CloseLibrary() procedure in order to recover
  68.      memory used for the library header, regardless of the value of
  69.      StayOpen when the library was opened.
  70.  
  71.         PROCEDURE OpenLibrary(WhichLib : Byte;
  72.                               LibraryName : String;
  73.                               StayOpen : Boolean);
  74.  
  75.         Example:  OpenLibrary(1,'Screens.Lib', True);
  76.  
  77.         PROCEDURE PopLib(WhichLib : Byte; ScreenName : String8);
  78.         Example:  PopLib(1,'MainMenu');
  79.  
  80.         PROCEDURE CloseLibrary(WhichLib : Byte);
  81.         Example:  CloseLibrary(1);
  82.  
  83.         FUNCTION  LibScreenName(WhichLib, ScreenNo : Byte) : String8;
  84.         Example:  ScreenName := LibScreenName(1,counter);
  85.  
  86.  
  87.      The following procedure is  all that is needed to display screens
  88.      from libraries stored in memory at runtime or linked in at compile
  89.      time:
  90.  
  91.         PROCEDURE PopLibMem(PtrToLib : Pointer; ScreenName : String8);
  92.         Example:  PopLibMem(@mylibrary,'MainMenu');
  93.  
  94.      If you need to interrogate the library directory contents use the
  95.      following function:
  96.  
  97.       FUNCTION  MemLibScreenName(PtrToLib : Pointer; number : Byte) : String8;
  98.  
  99.         Example:
  100.             Counter := 1;
  101.             Repeat { display all screens without knowing their names }
  102.               ScreenName := MemLibScreenName(@mylibrary,Counter);
  103.               if Length(screenname) > 0 then PopLibMem(@mylibrary,ScreenName);
  104.               Inc(Counter);
  105.             Until (Length(ScreenName) = 0) or (Counter > 100);
  106.  
  107.  
  108.      Now it is possible to control the display position of "sub-screens"
  109.      at run-time by calling the following procedure before calling any of
  110.      the above display routines to pop a sub-screen.  The column and row
  111.      parameters should correspond to the position that you wish the upper
  112.      left corner of the sub-screen to appear.  The coordinates you specify
  113.      will be used regardless of the position of the sub-screen when
  114.      originally saved with SAYWHAT?!  Set_Position_To() will have no effect
  115.      on full size screens.  { Please note that these column and row values
  116.      will not be affected by the Set_Coordinates_To procedure in
  117.      SAYGET4.TPU}
  118.  
  119.         PROCEDURE Set_Position_To(col,row : Byte);
  120.  
  121.         Example:  Repeat
  122.                      Set_Position_To(Random(79),Random(24));
  123.                      PopScreen(@subscreen);
  124.                   Until forever;
  125.  
  126.  
  127.   PROCEDURE FillPage(PagePtr : Pointer);
  128.      FillPage will make a copy of the current screen to any buffer
  129.      specified by the pointer specified.  It is up to you to make sure
  130.      that the buffer pointed to is of sufficient size to hold an entire
  131.      screen. 4000 bytes is slightly more than enough and easy to remember.
  132.      You may have as many screen buffers as you wish and PagePtr may also
  133.      point to the hardware video buffers (pages) if available.
  134.      Example:
  135.               VAR buffer : array[1..4000] of byte;
  136.               begin
  137.                 FillPage(@buffer);
  138.                 ....
  139.                 DisplayPage(@buffer);
  140.               end.
  141.  
  142.   PROCEDURE DisplayPage(PagePtr : Pointer);
  143.     Companion to FillPage(), displays a screen previously stored in buffer
  144.     at PagePtr.  No checking is done to determine if any image was in fact
  145.     stored at this location in memory.
  146.  
  147.   PROCEDURE Set_BW_On;
  148.     When SAYWHAT?! screens designed for color systems, are displayed on
  149.     composite monitors it is often best to turn off the color by calling
  150.     this procedure once in your program.  Once called, all color
  151.     information will be converted to black and white which will be
  152.     properly visible on a composite monitor.
  153.  
  154.   PROCEDURE Set_BW_Off;
  155.     Resets display routines to default state where SAYWHAT?! images
  156.     created and saved in color will be displayed in color.
  157.  
  158.   PROCEDURE Set_Status_Top;
  159.     Causes screens to be displayed with room for a status line at row 1.
  160.     This is the default setting.
  161.  
  162.   PROCEDURE Set_Status_Bottom;
  163.     Causes screens to be displayed with room for a status line at row 25.
  164.  
  165.   PROCEDURE Set_SnowProtection_On;
  166.     Screens will be displayed with snowless routines if the current
  167.     monitor is a CGA.
  168.  
  169.   PROCEDURE Set_SnowProtection_Off;
  170.     Screens will be displayed without regard for snow even if the current
  171.     monitor is a CGA.
  172.  
  173.   FUNCTION  AbsWhereX : Byte;     { returns cursor position regardless of windows }
  174.     Returns the absolute column position of the cursor regardless if any
  175.     Turbo Pascal windows are active.
  176.  
  177.   FUNCTION  AbsWhereY : Byte;
  178.     Returns the absolute row position of the cursor regardless if any
  179.     Turbo Pascal windows are active.
  180.  
  181.   FUNCTION  VideoMode : Byte;
  182.     Returns the numeric value of the current video mode as determined by
  183.     DOS.
  184.  
  185.   FUNCTION  GraphicsMode : Boolean;
  186.     Returns True if the current video mode is one of the various graphics
  187.     modes.
  188.  
  189.