home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
winutil
/
pbtool2i
/
demo.bas
< prev
next >
Wrap
BASIC Source File
|
1991-06-02
|
7KB
|
252 lines
$LIB ALL OFF
$ERROR ALL OFF
'Declarations for PBTools
PUBLIC Xpos%(), Ypos%(), WAttr%(), Xlen%(), Ylen%(), BAttr%(), ScrSav$(),_
Brdr%(), Shad%(), Pntr%(), CurWin%, MaxWin%
MaxWin%=20 'Defaults to 15, reset to 20 for demo.
$LINK "WINDO.PBU"
$LINK "SCRNIO.PBU"
$LINK "DOSIO.PBU"
$LINK "EMSIO.PBU"
$LINK "TOOL.PBU"
$SEGMENT
CALL InitPBScreen
CALL Fill(1,1,25,80,178,23)
CALL OpenWin(5,12,16,58,11,20,31,3,1,0)
CALL WPrintC(1,"PBTools 2.0h",0)
CALL WPrintC(2,"Copyright (c) 1990 by Dave Navarro, Jr.",0)
IF IsMouse% THEN Text$="Mouse" ELSE Text$="No Mouse"
Text$=Text$+" detected"
CALL WPrintC(4,Text$,0)
IF CurDisplay%=0 THEN Mon$="MONOCHROME"
IF CurDisplay%=1 THEN Mon$="CGA"
IF CurDisplay%=2 THEN Mon$="EGA"
IF CurDisplay%=3 THEN Mon$="MCGA"
IF CurDisplay%=4 THEN Mon$="VGA"
Text$=Mon$+" monitor is running in display mode"+STR$(VidMode%)
CALL WPrintC(5,Text$,0)
Text$="Video RAM segment located at "+HEX$(VidAddr%)+"H "
CALL WPrintC(6,Text$,0)
IF IsEMS% THEN Text$="EMS Version"+STR$(EMSVer%*.1) ELSE Text$="No EMS"
Text$=Text$+" detected"
IF IsEMS% THEN Text$=Text$+" with"+STR$(EMSFree%)+"K Bytes Free"
CALL WPrintC(7,Text$,0)
Text$="PBTools Demo is running on a"+STR$(CPU%)+" CPU"
CALL WPrintC(8,Text$,0)
Text$="System has"+STR$(INT(FRE(0)*.01))+"K Free RAM"
CALL WPrintC(9,Text$,0)
Text$="Current logged directory is "+CurDir$
CALL WPrintC(10,Text$,0)
Text$="Free space on drive "+CHR$(64+CurDrive%)+": is"
Text$=Text$+STR$(INT(DrvSpace#/1024))+"K"
CALL WPrintC(11,Text$,0)
IF DesqView% THEN Text$="DesqView has been detected" ELSE Text$="DesqView is not active"
CALL WPrintC(12,Text$,0)
CALL WPrintC(14,"Press Any Key to Continue",0)
I$=MouseKey$
CALL CloseWin
CALL OpenWin(2,20,4,45,2,30,31,3,0,0)
CALL WPrintC(1,"PB Tools 2.0h",0)
CALL WPrintC(2,"Copyright (c) 1990 by Dave Navarro, Jr. ",0)
CALL OpenWin(8,4,11,20,2,30,31,3,1,1)
DIM Menu1$(1:9)
Menu1$(1)=" Border Types "
Menu1$(2)=" Moving Windows "
Menu1$(3)=" Recoloring "
Menu1$(4)=" resiZing "
Menu1$(5)=" scroLling "
Menu1$(6)=" Shadows "
Menu1$(7)=" Titles "
Menu1$(8)=" Other Demos "
Menu1$(9)=" Exit Demo "
IF CurDisplay%=0 THEN Menu1$(3)=" --------------- "
IF CurDisplay%=0 THEN Hilite%=Attr%(0,7) ELSE Hilite%=Attr%(1,7)
XWin%=1:YWin%=2
'Note --> Changed Menu%() on 12-16-90, see docs for details!
MainMenu:
Choice%=Menu%(Menu1$(),1,9,Choice%,Hilite%,Attr%(14,1))
IF Choice%<1 THEN Choice%=9:GOTO MainMenu
IF Choice%=1 THEN BorTypes
IF Choice%=2 THEN MovingWin
IF Choice%=3 THEN CycleColors
IF Choice%=4 THEN Resize
IF Choice%=5 THEN Scrolling
IF Choice%=6 THEN Shadows
IF Choice%=7 THEN Titles
IF Choice%=9 THEN SayBye
GOTO MainMenu
Titles:
CALL OpenWin(7,14,15,55,2,30,31,3,1,0)
CALL WPrintC(6,"You can place titles in 6 different",0)
CALL WPrintC(8,"positions on the window border. ",0)
DELAY 1
CALL Title(1,0,"[Position 1]")
DELAY 1
CALL Title(2,0,"[Position 2]")
DELAY 1
CALL Title(3,0,"[Position 3]")
DELAY 1
CALL Title(4,0,"[Position 4]")
DELAY 1
CALL Title(5,0,"[Position 5]")
DELAY 1
CALL Title(6,0,"[Position 6]")
DELAY 4
CALL CloseWin
GOTO MainMenu
Shadows:
CALL OpenWin(6,13,10,30,2,30,31,0,1,0)
CALL WPrintC(4,"No Shadow!",0)
DELAY 2
CALL OpenWin(8,19,10,30,2,30,31,1,1,0)
CALL WPrintC(3,"Solid Shadow",0)
CALL WPrintC(5,"Drop Left",0)
DELAY 3
CALL OpenWin(10,25,10,30,2,30,31,2,1,0)
CALL WPrintC(3,"Solid Shadow",0)
CALL WPrintC(5,"Drop Right",0)
DELAY 3
CALL OpenWin(12,31,10,30,2,30,31,3,1,0)
CALL WPrintC(3,"Transparent Shadow",0)
CALL WPrintC(5,"Drop Left",0)
DELAY 3
CALL OpenWin(14,37,10,30,2,30,31,4,1,0)
CALL WPrintC(3,"Transparent Shadow",0)
CALL WPrintC(5,"Drop Right",0)
DELAY 3
CALL CloseWin
DELAY 1
CALL CloseWin
DELAY 1
CALL CloseWin
DELAY 1
CALL CloseWin
DELAY 1
CALL CloseWin
GOTO MainMenu
Scrolling:
CALL OpenWin(20,18,4,50,2,30,31,3,0,0)
CALL WPrintC(1,"Scroll the inside of a window any direction!",0)
CALL WPrintC(2,"Pres ESC to end scrolling demo.",0)
CALL OpenWin(8,28,10,50,2,30,31,3,0,0)
CALL WPrintC(1,"Bouncing!!",0)
Yscr%=1:XScr%=20:Xdir%=-1:Ydir%=1
LoopForEver:
IF Xdir%<0 THEN DECR XScr% ELSE INCR XScr%
IF Ydir%<0 THEN DECR YScr% ELSE INCR YScr%
IF XScr%<1 THEN Xdir%=1 ELSE IF XScr%>37 THEN Xdir%=-1
IF YScr%<3 THEN YDir%=1 ELSE IF YScr%>8 THEN YDir%=-1
IF Xdir%<0 THEN CALL ScrollWin(4) ELSE CALL ScrollWin(3)
IF Ydir%<0 THEN CALL ScrollWin(2) ELSE CALL ScrollWin(1)
FOR I%=-30000 TO 30000:NEXT I% ' Makes Demo Readable at 42 Mhz
IF INKEY$<>CHR$(27) THEN LoopForEver
CALL CloseWin
CALL CloseWin
GOTO MainMenu
Resize:
CALL OpenWin(20,18,4,50,2,30,31,3,0,0)
CALL WPrintC(1,"Resizing windows is easy!!",0)
CALL WPrintC(2,"Press ESC to end resizing demo.",0)
CALL OpenWin(7,35,9,25,2,30,31,0,0,0)
CALL WPrint(1,2,"Resizing!!!",0)
Xlen%=25:Ylen%=9:Xdir%=-1:Ydir%=-1
KeyLoop:
IF Xdir%<0 THEN DECR Xlen% ELSE INCR Xlen%
IF YDir%<0 THEN DECR Ylen% ELSE INCR Ylen%
IF XLen%<15 THEN Xdir%=1 ELSE IF Xlen%>34 THEN Xdir%=-1
IF Ylen%<3 THEN Ydir%=1 ELSE IF Ylen%>15 THEN Ydir%=-1
IF Xdir%<0 THEN CALL ChangeWin(2) ELSE CALL ChangeWin(1)
IF Ydir%<0 THEN CALL ChangeWin(4) ELSE CALL ChangeWin(3)
IF INKEY$<>CHR$(27) THEN KeyLoop
CALL CloseWin
CALL CloseWin
GOTO MainMenu
MovingWin:
CALL OpenWin(21,17,4,50,2,30,31,0,0,0)
CALL WPrintC(1,"Use Arrow Keys to move Menu",0)
CALL WPrintC(2,"Press ESC when your finished. ",0)
CurWin%=2 'Be Careful when you change the current windo!
CALL NoShadow
EndlessLoop:
I$=GetKey$
IF I$=CHR$(27) THEN NoMove
IF I$=CHR$(0)+CHR$(77) AND XWin%<57 THEN INCR Xwin%:CALL MoveWin(1)
IF I$=CHR$(0)+CHR$(75) AND XWin%>1 THEN DECR XWin%:CALL MoveWin(2)
IF I$=CHR$(0)+CHR$(80) AND YWin%<3 THEN INCR YWin%:CALL MoveWin(3)
IF I$=CHR$(0)+CHR$(72) AND YWin%>1 THEN DECR YWin%:CALL MoveWin(4)
GOTO EndlessLoop
NoMove:
CurWin%=3
CALL CloseWin
CALL AddShadow(3)
GOTO MainMenu
CycleColors:
IF CurDisplay%=0 THEN MainMenu
CurWin%=1
FOR I%=128 TO 1 STEP -1
CALL WinColor(I%)
FOR T%=1 TO 32000:NEXT T%
IF INKEY$<>"" THEN EXIT FOR
NEXT I%
CALL WinColor%(31)
CurWin%=2
GOTO MainMenu
BorTypes:
CALL OpenWin(7,4,17,76,2,30,31,3,0,0)
IF CurDisplay%=0 THEN Normal%=Attr%(0,7) ELSE Normal%=Attr%(1,7)
FOR I%=3 TO 0 STEP -1
CALL OpenWin(8,14+(I%*15),5,13,I%,Normal%,Normal%,3,0,0)
CALL Title(1,0,"[Frame"+STR$(I%)+"]")
NEXT I%
FOR I%=4 TO 0 STEP -1
CALL OpenWin(11,8+(I%*14),5,13,I%+4,Attr%(14,4),Attr%(14,4),3,0,0)
CALL Title(1,0,"[Frame"+STR$(I%+4)+"]")
NEXT I%
FOR I%=2 TO 0 STEP -1
CALL OpenWin(14,19+(I%*17),5,14,I%+9,Attr%(15,5),Attr%(15,5),3,0,0)
CALL Title(2,0,"[Frame"+STR$(I%+9)+"]")
NEXT I%
FOR I%=1 TO 0 STEP -1
CALL OpenWin(17,28+(I%*17),5,14,I%+12,Attr%(8,7),Attr%(8,7),3,0,0)
CALL Title(2,0,"[Frame"+STR$(I%+12)+"]")
NEXT I%
I$=MouseKey$
FOR I%=0 TO 14
CALL CloseWin
NEXT I%
GOTO MainMenu
SayBye:
CALL OpenWin(1,1,25,80,0,7,7,0,1,0)
LOCATE 1,1
PRINT "Thanks for giving PB Tools 2.0 a try!"
END