home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / FOXPCX.ZIP / FOXPCX.PRG < prev    next >
Encoding:
Text File  |  1994-10-29  |  5.4 KB  |  238 lines

  1. ************************************************************************
  2. ** Demo program for FOXPCX.PLB                                          *
  3. ** (c) 1991-94 Master Creative Software, Inc.                           *
  4. ** Please feel free to use any or all of this code in your app           *
  5. ************************************************************************
  6. * Last Updated 10/27/94 1:45pm WSM
  7.  
  8.  
  9. Clear all
  10. Close All
  11. Clear
  12. Set Talk off
  13. Set Echo Off
  14. Set Escape off
  15. set textmerge  show
  16.  
  17. Use DRIVERS
  18.  
  19. Public _MEMTYP,_LRGEBUF
  20.  
  21. Set sysmenu on
  22. Define Window PRNWIND from 0,0 to 23,79 TITLE ;
  23. " [ FOXPCX Documentation ]"  PANEL COLOR w/n,n/w,w/n
  24. Set sysmenu off
  25.  
  26.  
  27. Define Popup WhichDrv Prompt Field DESC Footer "Select Screen Driver"
  28. On Selection POPUP WhichDrv DO View With Prompt(),PCX_FILE
  29.  
  30. DEFINE POPUP MEM MARGIN RELATIVE SHADOW COLOR SCHEME 4
  31.  
  32. DEFINE BAR 1 OF MEM PROMPT 'Use \<XMS Memory' 
  33. DEFINE BAR 2 OF MEM PROMPT 'Use FOXPCX \<Virtual Memory System' 
  34.  
  35. ON SELECTION POPUP MEM    DO MEMchoice WITH BAR()
  36.  
  37. DEFINE POPUP BUF MARGIN RELATIVE SHADOW COLOR SCHEME 4
  38. DEFINE BAR 1 OF BUF PROMPT 'Use Small 4K Page Buffer' 
  39. DEFINE BAR 2 OF BUF PROMPT 'Use Large 8K Page Buffer' 
  40. ON SELECTION POPUP BUF    DO BUFchoice WITH BAR()
  41.  
  42. Clear
  43. Do Displogo
  44. Wait Window
  45. Do While .T.
  46.     Clear
  47.     Do Displogo
  48.     PCX_file = GETFILE('PCX', 'Select PCX File to View',"Browse",1)
  49.     if empty(PCX_FILE)
  50.         exit
  51.     Endif
  52.     @24,0 say padc("Hit <Esc>-To Exit",80)
  53.     activate popup MEM
  54.     activate popup BUF
  55.     Activate POPUP WhichDrv
  56. Enddo
  57.  
  58. clear
  59. modi file FOXPCX.DOC NOMOD WINDOW PRNWIND
  60. Release Window PRNWIND
  61. USE
  62. Clear all
  63. clear
  64. Set Libr to
  65. do displogo
  66.  
  67.  
  68.  
  69. ***************************************************************
  70. Procedure View
  71. ***************************************************************
  72. Parameters DRV,PCX_FlE
  73. Clear
  74. Hide POPUP WhichDrv
  75.  
  76. @21,0 Say Padc("Will Display PCX File "+PCX_FLE+" With :"+DRV,80)
  77. Wait "Strike any key to View PCX File" Window
  78. Set Talk on
  79.  
  80. if "2.0" $version() 
  81.     set libr to foxpcx20
  82. else
  83.     set libr to foxpcx
  84. endif
  85.     
  86. _FRet=ViewPCX(PCX_FLE,@DRIVER,_MEMTYP,_LRGEBUF,0)
  87. Set Talk off
  88. Set Libr To
  89. Clear
  90. Wait "FoxPCX Returned "+Transf(_Fret,"999")+" = "+PCX_ERROR(_Fret) Timeout 2
  91. Deactivate POPUP WhichDrv
  92. Return
  93.  
  94.  
  95. ******************************************************************
  96. PROCEDURE MEMchoice
  97. ******************************************************************
  98. PARAMETERS _MT
  99.  
  100. _MEMTYP = _MT - 1
  101.  
  102. Deactivate POPUP MEM
  103.  
  104.  
  105. ******************************************************************
  106. PROCEDURE BUFchoice
  107. ******************************************************************
  108. PARAMETERS _MT
  109.  
  110. _LRGEBUF=_MT-1
  111.  
  112. Deactivate POPUP BUF
  113.  
  114.  
  115. ************************************
  116. Procedure PCX_ERROR
  117. ***********************************
  118. Parameters _ER
  119.  
  120. do case
  121. Case _ER=0
  122.     return "No Errors Detected"
  123.     * Success !
  124. Case _ER=100
  125.  
  126.     return "XMS driver not detected"
  127.     ** XMS Memory Requested and not available
  128.     ** XMS Driver may not be loaded or not enough XMS free
  129.     ** make sure HIMEM or a memory manager like QEMM is loaded
  130.  
  131. Case _ER=101
  132.     return "Error allocating XMS memory block"
  133.     ** Probably not enough XMS.
  134.  
  135. Case _ER=102
  136.     return "Error allocating VMS memory block"
  137.     ** Virtual memory manager failure. Check your disk space.
  138.  
  139. Case _ER=103
  140.     return "Error writing XMS memory block"
  141.  
  142. Case _ER=104
  143.     return "Error reading XMS memory block"
  144. Case _ER=105
  145.     return "Error writing VMS memory block"
  146.     ** Error Writing to Virtual memory Swap File. Check Disk Space.
  147.  
  148. Case _ER=106
  149.     return "Error reading VMS memory block"
  150.     ** Error Reading Virtual memory Swap File. Check Disk .
  151.  
  152. Case _ER=107
  153.     return "Error decoding PCX Image"
  154.     ** Error PCX Decoder Error. PCX file could be damaged.
  155.  
  156. Case _ER=108
  157.     return "file i/o error"
  158. Case _ER=109
  159.     return "FOXPRO memory allocation error"
  160.     ** Remove TSR and/or other PLB files Etc..
  161.  
  162. Case _ER=110
  163.     return "error loading screen driver"
  164.     ** Check to see if the driver is valid and exists.
  165.  
  166. Case _ER=111
  167.     return "error calling screen driver"
  168. Case _ER=112
  169.     return "invalid driver "
  170.     * Not a Supported Driver  OR
  171.     * driver file probably damaged.
  172.  
  173. Case _ER=113
  174.     return "error opening file"
  175. Case _ER=114
  176.     return "FOXPCX requires VGA or better"
  177. Case _ER=115
  178.     return "error opening PCX image"
  179. Case _ER=116
  180.     return "error allocating XMS"
  181. Case _ER=117
  182.     return "Error in Parameter 1"
  183. Case _ER=118
  184.     return "Error in Parameter 2"
  185. Case _ER=119
  186.     return "Error in Parameter 3"
  187. Case _ER=120
  188.     return "Error in Parameter 4"
  189. Case _ER=121
  190.     return "This is not a PCX file"
  191. Case _ER=122
  192.     return "driver load error (size)"
  193. Case _ER=123
  194.     return "error allocating driver resources"
  195. Case _ER=124
  196.     return "driver does not support > 256 Colors"
  197. EndCase
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210. *******************************
  211. Procedure Displogo
  212. *******************************
  213. @7,0 Say ""
  214. TEXT
  215.                   █████  ███   █   █  ██████    ███    █   █ 
  216.                    █  █ ██ ██  █   █   █   ██  ██ ███  █   █ 
  217.                    █ █  █   █  ██ ██   █   ██ ██       ██ ██ 
  218.                    ███  █   █   ███    █████  ██        ███  
  219.                    █ █  █   █   ███    █      ██        ███  
  220.                    █    ██ ██  ██ ██   █       ██ ███  ██ ██ 
  221.                   ███    ███   █   █  ███       ███    █   █ 
  222. ENDTEXT
  223. @18,0 Say padc("FOXPCX DEMO Version 3.0",80)
  224. @19,0 Say padc("(c) 1991-94 Master Creative Software, Inc",80)
  225. @20,0 Say padc("Compuserve 70713,2002 BBS 201-585-7002",80)
  226.  
  227. Return
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.