home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / SW_45B.ZIP / SW45DEMO.BAT < prev   
DOS Batch File  |  1993-08-09  |  10KB  |  370 lines

  1. @ECHO OFF
  2. if not %1!==! goto %1
  3.  
  4. : REM A pre-SW screen just for effect
  5. : REM make sure the screen is default white on black
  6. : REM reset border
  7. sw /o
  8. : REM save existing prompt
  9. set sav=%prompt%
  10. : REM make sure there was room in environment
  11. if not %sav%!==%prompt%! goto skip
  12. set prompt=$e[0m$p$g
  13. @echo on
  14. cls
  15. @echo off
  16.  echo.
  17.  echo.
  18.  echo.
  19.  echo.
  20.  echo.
  21.  echo.
  22.  echo.
  23.  echo                           Are Your Batch Files Dull?
  24.  echo.
  25.  echo                                    Lifeless?
  26.  echo.
  27.  echo                                     Boring?
  28.  echo.
  29.  echo                          SCREEN WIZARD is the answer!
  30.  echo.
  31.  echo.
  32.  echo.
  33.  echo.
  34.  echo.
  35.  echo.
  36.  echo.
  37.  echo.
  38.  pause
  39.  set prompt=%sav%
  40.  set sav=
  41.  
  42. :skip
  43. : REM skip over screen definitions
  44. : REM Put screen definitions at the beginning of the file for fastest execution
  45.  goto begin
  46.  
  47. : REM Screen definition with default label
  48. : REM Windows are drawn in the order defined. Pause, Query and User Input will
  49. : REM occur as they are encountered. SW will return only the last Query result.
  50.  
  51. :Display
  52. _window /kcya┼ /r2 /s /bred /w /0 /z
  53. SCREEN WIZARD - Expanded Text Handling!
  54. /tWHI+ Multiple Windows!
  55. /m  v 4.5 
  56. _window /r10 /s /bwhi /gblu /l1 /fred /0
  57. /tBLU Optional Command Line Syntax:
  58. SW @filename [label]
  59. _window /r16 /s /bwhi /gblu /l1 /fred /0
  60. /tBLU SW 4.x ADDITIONAL FEATURES
  61. /tred /─
  62. /jl "- Define the entire screen with multiple windows   "
  63.   using external text files.
  64. _window /r25 /l0 /0 /p100- /d
  65. " - Press any key for more - "
  66. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  67. "- Using labels, more than one definition can be    "
  68.   included in the same file.
  69. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  70. "- The screen definition can be included inside the "
  71.   calling batch file!
  72. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  73. "- SW can evaluate Environment Variables included   "
  74.   inside screen definitions.
  75. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  76. "- Screen definitions can include a special Help    "
  77.   section that can be called up with the F1 key.
  78. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1 /p100-
  79. "- {NEW!}  Highlighting can be a different color on   "
  80. /ered   each line. Highlight blocks with{ {{braces}}}.
  81. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1000 /p100-
  82. "- {NEW!}  Screen Saver for Query and User Input. Delay"
  83.   from 1 to 30 minutes or disable with /D#.
  84. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a220-1760 /p5- /d
  85. "- {NEW!}  Alert tones can be swept up or down in     "
  86.   programmable steps.
  87. _window /a1760-220,20 /p100-
  88. _window /r16 /bwhi /gblu /fred /0 /3d /a4 /p100-
  89. /jc /tBLU SW 4.x ADDITIONAL FEATURES
  90. /tred /─/
  91. /jl "- {NEW!}  Window frame can have a 3-D affect. It can "
  92.   be set or it can follow the /S switch.
  93. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2 /p100-
  94. "- {BONUS!}  SWV.EXE Text File Viewer available when    "
  95.   registering SW / DI.
  96. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a3 /p100-
  97. "- {BONUS!}  SW-DOS.EXE DOS Window Shell available when "
  98.   registering SW / DI.
  99. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /ac7,2
  100. "- {BONUS!}  SW-DIR.EXE File Picker available when      "
  101.   registering SW / DI.
  102. _window /r25 /l0 /0 /p200- /d
  103. " - Press any key to continue - "
  104. :end_display
  105.  
  106. : REM screen definition showing a menu with user defined label
  107.  
  108. :Snd_menu
  109. _window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
  110. SCREEN WIZARD - Sounds!
  111. /m " v 4.5 "
  112. _window /r11 /s /l1 /w
  113. /eYEL /mc ~┤ Play a Sound ~├
  114. /eRED "~Low Tone   ~Mid Tone   ~High Tone"
  115. "Bweep ~1    Bweep ~2    ~Bomb     "
  116. "~Siren      ~Phasor     ~Tweeter  "
  117. "Sweep ~Up   Sweep ~Down          "
  118. /─/
  119. Close ~Encounters   ~Charge 
  120. Beethoven's ~5th   ~WZLX  
  121. /m [ {ESC} Exit   {F1} Help ]
  122. :end_Snd_Menu
  123.  
  124. : REM Screen def to handle Sound Menu query and demo help screen feature
  125.  
  126. :Snd_Query
  127. _window /q~lmh12bsptce5wud
  128. _window_help /s /bwhi /fred /gblu
  129. This menu enables you to try all of the preprogrammed 
  130. sounds in SW as well as a couple of Sweep examples and
  131. some quick tunes.  Press the highlighted key to select.
  132. /tgre /m [ ESC ]
  133. :end_Snd_Query
  134.  
  135. : REM screen definition showing a menu with another user defined label
  136.  
  137. :4.5
  138. _window /r125 /c180 /z /bwhi /l0 /o
  139.  
  140. _window /kwhi┴───┬── /r4 /bred /l5 /0 /z /kblu /@-
  141. SCREEN WIZARD - Bye, Bye ECHO!
  142. /m  v 4.5 
  143. _window /tRED /r11 /fWHI
  144. They can also be placed anywhere on the screen they'll fit!
  145. _window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
  146. Upper Left
  147. _window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
  148. Upper Right
  149. _window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
  150. Lower Right
  151. _window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
  152. Lower Left
  153. _window /r18 /fWHI /tYEL+ /b4 /l5
  154. (c) 1992   Warren Small
  155. :end_4.5
  156.  
  157. :Charge
  158. _window /aC4,2
  159. _window /aF4,2
  160. _window /aA4,2
  161. _window /aC5,4
  162. _window /aA4,2
  163. _window /aC5,5
  164. :End_Charge
  165.  
  166. :Close
  167. _window /aA4,3
  168. _window /aB4,3
  169. _window /aG4,3
  170. _window /aG3,3
  171. _window /aD4,10
  172. :End_Close
  173.  
  174. :WZLX
  175. _window /aE5
  176. _window /aG5
  177. _window /aB5
  178. _window /aE6
  179. _window /aB5
  180. _window /aG5
  181. _window /aE5
  182. :End_WZLX
  183.  
  184. :Fifth
  185. _window /aG4,2
  186. _window /aG4,2
  187. _window /aG4,2
  188. _window /aE4b,8
  189. _window /p4
  190. _window /aF4,2
  191. _window /aF4,2
  192. _window /aF4,2
  193. _window /aD4,8
  194. :End_Fifth
  195.  
  196. : REM labels for Alert sounds demos near the beginning of file 
  197. : REM for faster execution
  198.  
  199. :beep1
  200.  sw /a1
  201.  goto BeepDemo
  202.  
  203. :beep2
  204.  sw /a2
  205.  goto BeepDemo
  206.  
  207. :beep3
  208.  sw /a3
  209.  goto BeepDemo
  210.  
  211. :beep4
  212.  sw /a4
  213.  goto BeepDemo
  214.  
  215. :beep5
  216.  sw /a5
  217.  goto BeepDemo
  218.  
  219. :beep6
  220.  sw /a6
  221.  goto BeepDemo
  222.  
  223. :beep7
  224.  sw /a7
  225.  goto BeepDemo
  226.  
  227. :beep8
  228.  sw /a8
  229.  goto BeepDemo
  230.  
  231. :beep9
  232.  sw /a9
  233.  goto beepdemo
  234.  
  235. :beep10
  236.  sw @sw45demo.bat charge
  237.  goto beepdemo
  238.  
  239. :beep11
  240.  sw @sw45demo.bat close
  241.  goto beepdemo
  242.  
  243. :beep12
  244.  sw @sw45demo.bat Fifth
  245.  goto beepdemo
  246.  
  247. :beep13
  248.  sw @sw45demo.bat WZLX
  249.  goto beepdemo
  250.  
  251. :beep14
  252.  sw /a110-3520,12
  253.  goto beepdemo
  254.  
  255. :beep15
  256.  sw /a3520-110,6
  257.  goto beepdemo
  258.  
  259. : REM Alternate errorlevel check using FOR loop
  260.  
  261. :beepdemo
  262. : REM Query is handled in a separate screen def so that I won't waste time
  263. : REM redrawing the menu after each sound.
  264.  
  265.  sw @sw45demo.bat Snd_Query
  266.  
  267. : REM Errorlevels checked by FOR IN DO loop makes for a short line but
  268. : REM slower processing
  269.  
  270.  for %%e in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) do if errorlevel %%e goto beep%%e
  271.  if not errorlevel 1 goto DI
  272.  goto beepdemo
  273.  
  274. : REM Command line examples, positioning, colors, shadows, pause, Wide edge
  275. : REM Color numbers are used to shorten the line
  276. : REM Command line cannot exceed 128 characters
  277.  
  278. :begin
  279.  sw /r125 /c180 /z /l0 " " /bwhi
  280.  sw /kwhi[_] /kred /r2 /s /bred "SCREEN WIZARD - Enhance Your Batch Files!" /0 /w /m " v 4.5 " /o /z
  281.  sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  282.  sw /r18 /l3 /t11 "Display up to 50 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  283.  sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  284.  
  285. : REM More command line examples, justify, borders
  286.  
  287.  sw /kcya░ /r2 /s /bred "SCREEN WIZARD - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.5 " /z
  288.  sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  289.  sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for fill" "& make windows with shadows." /0 /s
  290.  sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
  291.  sw /bwhi /r19 /gyel /l0 /0 /c68 /jr " Justify " "Text " "Right "
  292.  sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  293.  
  294.  set colr=bla
  295. : REM Make sure there was room in the environment
  296.  if not "%colr%"=="bla" goto next
  297.  
  298. : REM Another command line example, Query with default, Border Message, Draw
  299. : REM Draw a full screen window
  300.  sw /r125 /c180 /o1 " "
  301.  sw /r3 /s /bred "SCREEN WIZARD - Flow Control for BAT's!" /w /0 /m " v 4.5 " /z
  302.  
  303. : REM The following line is longer than 128 characters BUT it works because 
  304. : REM when the line is processed by DOS, the %colr% variable is replaced by
  305. : REM the color value making the command line 3 characters shorter.
  306.  
  307. :colors
  308.  sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press ~E~S~C to go on..." /q~bcwg /2 /l5 /d
  309.  
  310.  if errorlevel 4 set colr=gre
  311.  if errorlevel 4 goto colors
  312.  if errorlevel 3 set colr=whi
  313.  if errorlevel 3 goto colors
  314.  if errorlevel 2 set colr=cya
  315.  if errorlevel 2 goto colors
  316.  if errorlevel 1 set colr=yel
  317.  if errorlevel 1 goto colors
  318.  
  319. :next
  320.  set colr=
  321.  
  322. : REM Display screen definition with default label
  323.  sw @sw45demo.bat
  324.  
  325. : REM Display screen definition in external file
  326.  sw @sw-45.new
  327.  
  328. : REM Display screen definition with label 'Snd_menu'
  329.  sw @sw45demo.bat Snd_menu
  330.  
  331. : REM Query is handled separately beacause I wanted to return to the menu
  332. : REM after processing the response without redoing the screen.
  333. : REM I also placed it nearer the top of the file to speed it up.
  334.  goto beepdemo
  335.  
  336. : REM create screen definition on the fly to demo DI.EXE
  337. :DI
  338.  if exist di.hlp goto DI_Display
  339.  sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  340.  echo : REM This file was created by SW45DEMO.BAT > di.hlp
  341.  echo : REM If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  342.  echo : REM                       "SW @DI.HLP" >> di.hlp
  343.  echo.>> di.hlp
  344.  echo :Display >> di.hlp
  345.  echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  346.  echo SCREEN WIZARD - Now with DI!>> di.hlp
  347.  echo /mc  v 4.5 >> di.hlp
  348.  echo _window /jl /s /0 /r9 >> di.hlp
  349.  echo /mc  Disk Information >> di.hlp
  350.  echo.>> di.hlp
  351.  di >> di.hlp
  352.  echo. >> di.hlp
  353.  echo /m /eYEL "~╡ Press any key to continue ~╞">> di.hlp
  354.  echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  355.  echo :End_Display >> di.hlp
  356.  
  357. :DI_Display
  358.  sw @di.hlp
  359.  
  360. : REM Display screen definition with label '4.5'
  361. :final
  362.  sw @sw45demo.bat 4.5
  363.  for %%t in (10 9 8 7 6 5 4 3 2 1) do sw /r25 /l0 /0 /a10000,1 /p8- " - Pausing %%t seconds - " /@-
  364.  sw /r25 /l0 /0 /a60,1 /p2 " - Outta Here! - "
  365.  if exist sw-big.sw sw @sw-big.sw
  366.  
  367. : REM display help screen
  368. :help
  369.  sw
  370.