home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
SW_45B.ZIP
/
SW45DEMO.BAT
< prev
Wrap
DOS Batch File
|
1993-08-09
|
10KB
|
370 lines
@ECHO OFF
if not %1!==! goto %1
: REM A pre-SW screen just for effect
: REM make sure the screen is default white on black
: REM reset border
sw /o
: REM save existing prompt
set sav=%prompt%
: REM make sure there was room in environment
if not %sav%!==%prompt%! goto skip
set prompt=$e[0m$p$g
@echo on
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo Are Your Batch Files Dull?
echo.
echo Lifeless?
echo.
echo Boring?
echo.
echo SCREEN WIZARD is the answer!
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
set prompt=%sav%
set sav=
:skip
: REM skip over screen definitions
: REM Put screen definitions at the beginning of the file for fastest execution
goto begin
: REM Screen definition with default label
: REM Windows are drawn in the order defined. Pause, Query and User Input will
: REM occur as they are encountered. SW will return only the last Query result.
:Display
_window /kcya┼ /r2 /s /bred /w /0 /z
SCREEN WIZARD - Expanded Text Handling!
/tWHI+ Multiple Windows!
/m v 4.5
_window /r10 /s /bwhi /gblu /l1 /fred /0
/tBLU Optional Command Line Syntax:
SW @filename [label]
_window /r16 /s /bwhi /gblu /l1 /fred /0
/tBLU SW 4.x ADDITIONAL FEATURES
/tred /─
/jl "- Define the entire screen with multiple windows "
using external text files.
_window /r25 /l0 /0 /p100- /d
" - Press any key for more - "
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- Using labels, more than one definition can be "
included in the same file.
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- The screen definition can be included inside the "
calling batch file!
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- SW can evaluate Environment Variables included "
inside screen definitions.
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- Screen definitions can include a special Help "
section that can be called up with the F1 key.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1 /p100-
"- {NEW!} Highlighting can be a different color on "
/ered each line. Highlight blocks with{ {{braces}}}.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1000 /p100-
"- {NEW!} Screen Saver for Query and User Input. Delay"
from 1 to 30 minutes or disable with /D#.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a220-1760 /p5- /d
"- {NEW!} Alert tones can be swept up or down in "
programmable steps.
_window /a1760-220,20 /p100-
_window /r16 /bwhi /gblu /fred /0 /3d /a4 /p100-
/jc /tBLU SW 4.x ADDITIONAL FEATURES
/tred /─/
/jl "- {NEW!} Window frame can have a 3-D affect. It can "
be set or it can follow the /S switch.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2 /p100-
"- {BONUS!} SWV.EXE Text File Viewer available when "
registering SW / DI.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a3 /p100-
"- {BONUS!} SW-DOS.EXE DOS Window Shell available when "
registering SW / DI.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /ac7,2
"- {BONUS!} SW-DIR.EXE File Picker available when "
registering SW / DI.
_window /r25 /l0 /0 /p200- /d
" - Press any key to continue - "
:end_display
: REM screen definition showing a menu with user defined label
:Snd_menu
_window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
SCREEN WIZARD - Sounds!
/m " v 4.5 "
_window /r11 /s /l1 /w
/eYEL /mc ~┤ Play a Sound ~├
/eRED "~Low Tone ~Mid Tone ~High Tone"
"Bweep ~1 Bweep ~2 ~Bomb "
"~Siren ~Phasor ~Tweeter "
"Sweep ~Up Sweep ~Down "
/─/
Close ~Encounters ~Charge
Beethoven's ~5th ~WZLX
/m [ {ESC} Exit {F1} Help ]
:end_Snd_Menu
: REM Screen def to handle Sound Menu query and demo help screen feature
:Snd_Query
_window /q~lmh12bsptce5wud
_window_help /s /bwhi /fred /gblu
This menu enables you to try all of the preprogrammed
sounds in SW as well as a couple of Sweep examples and
some quick tunes. Press the highlighted key to select.
/tgre /m [ ESC ]
:end_Snd_Query
: REM screen definition showing a menu with another user defined label
:4.5
_window /r125 /c180 /z /bwhi /l0 /o
_window /kwhi┴───┬── /r4 /bred /l5 /0 /z /kblu /@-
SCREEN WIZARD - Bye, Bye ECHO!
/m v 4.5
_window /tRED /r11 /fWHI
They can also be placed anywhere on the screen they'll fit!
_window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
Upper Left
_window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
Upper Right
_window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
Lower Right
_window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
Lower Left
_window /r18 /fWHI /tYEL+ /b4 /l5
(c) 1992 Warren Small
:end_4.5
:Charge
_window /aC4,2
_window /aF4,2
_window /aA4,2
_window /aC5,4
_window /aA4,2
_window /aC5,5
:End_Charge
:Close
_window /aA4,3
_window /aB4,3
_window /aG4,3
_window /aG3,3
_window /aD4,10
:End_Close
:WZLX
_window /aE5
_window /aG5
_window /aB5
_window /aE6
_window /aB5
_window /aG5
_window /aE5
:End_WZLX
:Fifth
_window /aG4,2
_window /aG4,2
_window /aG4,2
_window /aE4b,8
_window /p4
_window /aF4,2
_window /aF4,2
_window /aF4,2
_window /aD4,8
:End_Fifth
: REM labels for Alert sounds demos near the beginning of file
: REM for faster execution
:beep1
sw /a1
goto BeepDemo
:beep2
sw /a2
goto BeepDemo
:beep3
sw /a3
goto BeepDemo
:beep4
sw /a4
goto BeepDemo
:beep5
sw /a5
goto BeepDemo
:beep6
sw /a6
goto BeepDemo
:beep7
sw /a7
goto BeepDemo
:beep8
sw /a8
goto BeepDemo
:beep9
sw /a9
goto beepdemo
:beep10
sw @sw45demo.bat charge
goto beepdemo
:beep11
sw @sw45demo.bat close
goto beepdemo
:beep12
sw @sw45demo.bat Fifth
goto beepdemo
:beep13
sw @sw45demo.bat WZLX
goto beepdemo
:beep14
sw /a110-3520,12
goto beepdemo
:beep15
sw /a3520-110,6
goto beepdemo
: REM Alternate errorlevel check using FOR loop
:beepdemo
: REM Query is handled in a separate screen def so that I won't waste time
: REM redrawing the menu after each sound.
sw @sw45demo.bat Snd_Query
: REM Errorlevels checked by FOR IN DO loop makes for a short line but
: REM slower processing
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
if not errorlevel 1 goto DI
goto beepdemo
: REM Command line examples, positioning, colors, shadows, pause, Wide edge
: REM Color numbers are used to shorten the line
: REM Command line cannot exceed 128 characters
:begin
sw /r125 /c180 /z /l0 " " /bwhi
sw /kwhi[_] /kred /r2 /s /bred "SCREEN WIZARD - Enhance Your Batch Files!" /0 /w /m " v 4.5 " /o /z
sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
sw /r18 /l3 /t11 "Display up to 50 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
: REM More command line examples, justify, borders
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
sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for fill" "& make windows with shadows." /0 /s
sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
sw /bwhi /r19 /gyel /l0 /0 /c68 /jr " Justify " "Text " "Right "
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
set colr=bla
: REM Make sure there was room in the environment
if not "%colr%"=="bla" goto next
: REM Another command line example, Query with default, Border Message, Draw
: REM Draw a full screen window
sw /r125 /c180 /o1 " "
sw /r3 /s /bred "SCREEN WIZARD - Flow Control for BAT's!" /w /0 /m " v 4.5 " /z
: REM The following line is longer than 128 characters BUT it works because
: REM when the line is processed by DOS, the %colr% variable is replaced by
: REM the color value making the command line 3 characters shorter.
:colors
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
if errorlevel 4 set colr=gre
if errorlevel 4 goto colors
if errorlevel 3 set colr=whi
if errorlevel 3 goto colors
if errorlevel 2 set colr=cya
if errorlevel 2 goto colors
if errorlevel 1 set colr=yel
if errorlevel 1 goto colors
:next
set colr=
: REM Display screen definition with default label
sw @sw45demo.bat
: REM Display screen definition in external file
sw @sw-45.new
: REM Display screen definition with label 'Snd_menu'
sw @sw45demo.bat Snd_menu
: REM Query is handled separately beacause I wanted to return to the menu
: REM after processing the response without redoing the screen.
: REM I also placed it nearer the top of the file to speed it up.
goto beepdemo
: REM create screen definition on the fly to demo DI.EXE
:DI
if exist di.hlp goto DI_Display
sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
echo : REM This file was created by SW45DEMO.BAT > di.hlp
echo : REM If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
echo : REM "SW @DI.HLP" >> di.hlp
echo.>> di.hlp
echo :Display >> di.hlp
echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
echo SCREEN WIZARD - Now with DI!>> di.hlp
echo /mc v 4.5 >> di.hlp
echo _window /jl /s /0 /r9 >> di.hlp
echo /mc Disk Information >> di.hlp
echo.>> di.hlp
di >> di.hlp
echo. >> di.hlp
echo /m /eYEL "~╡ Press any key to continue ~╞">> di.hlp
echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
echo :End_Display >> di.hlp
:DI_Display
sw @di.hlp
: REM Display screen definition with label '4.5'
:final
sw @sw45demo.bat 4.5
for %%t in (10 9 8 7 6 5 4 3 2 1) do sw /r25 /l0 /0 /a10000,1 /p8- " - Pausing %%t seconds - " /@-
sw /r25 /l0 /0 /a60,1 /p2 " - Outta Here! - "
if exist sw-big.sw sw @sw-big.sw
: REM display help screen
:help
sw