'=========================================================================== ' Subject: QB SCREEN SAVER VIEWER V1.00 Date: 04-09-99 (17:30) ' Author: James Salim Code: QB, QBasic, PDS ' Origin: j_sal@one.net.au Packet: GRAPHICS.ABC '=========================================================================== '*************************************************************************** '* QB Screen Saver Viewer Ver 1.00 * '* SCRSAVER.BAS * '*************************************************************************** '* Use: List and View all screen saver files found on the c: drive * '* Programmer: James Salim (e-mail : j_sal@one.net.au) * '*************************************************************************** DECLARE SUB KillTmp () DECLARE SUB DrwBox (x1!, y1!, x2!, y2!, Style!, colour!, BgrColour!) DECLARE SUB PrintCentre (Text$, y!, colour!, BgrColour!) DECLARE SUB PrintLst (Method!) COMMON SHARED ScrSaverMax, yIndex, CurIndex, ShowLst, MaxLine MaxLine = 45 - 2 yIndex = 0 CurIndex = 1 DIM SHARED ScrSaverLst$(300) SCREEN 0, 0, 0 CLS COLOR 15, 0: PRINT "Creating Screen saver list." PRINT "Please Wait"; COLOR 31, 0: PRINT " ..."; COLOR 15, 0, 0 SHELL "dir c:\*.SCR /s/b/l > temp.lst" i = 0 OPEN "temp.lst" FOR INPUT AS #1 DO WHILE NOT EOF(1) i = i + 1 INPUT #1, Lst$ ScrSaverLst$(i) = Lst$ + STRING$(78 - LEN(Lst$), " ") LOOP ScrSaverMax = i CLOSE #1 WIDTH 80, 50 Start: CLS LOCATE 50, 1: PRINT "QB Screen Saver Viewer Ver 1.00 James Salim (E-mail:j_sal@one.net.au)" DrwBox 1, 1, 80, 45, 2, 15, 1 PrintCentre " QB Screen Saver Viewer ", 1, 15, 1 PrintLst 0 DrwBox 1, 46, 80, 48, 2, 15, 0 COLOR 15, 0, 0 COLOR 14, 0 LOCATE 47, 2: PRINT "ENTER - Preview P - Properties ESC - Quit "; CHR$(24); CHR$(25); " - Move" DO k$ = INKEY$ IF k$ = CHR$(27) THEN GOTO EndProg IF k$ = "P" OR k$ = "p" THEN GOTO Properties IF k$ = CHR$(13) THEN GOTO Preview IF k$ = CHR$(0) + "H" THEN PrintLst -1 IF k$ = CHR$(0) + "P" THEN PrintLst 1 LOOP EndProg: SCREEN 0, 0, 0: WIDTH 80, 25: COLOR 7, 0, 0: CLS KILL "temp.lst" KillTmp DrwBox 14, 5, 66, 12, 2, 12, 1 PrintCentre "QB Screen Saver Viewer 1.00", 6, 14, 1 PrintCentre "FREEWARE", 7, 15, 1 PrintCentre "Programmed by:", 9, 15, 1 PrintCentre "James Salim", 10, 15, 1 PrintCentre "E-mail: j_sal@one.net.au", 11, 15, 1 a$ = INPUT$(1) SCREEN 0, 0, 0 CLS END Properties: COLOR 7, 0 CLS KillTmp SHELL "COPY " + CHR$(34) + RTRIM$(ScrSaverLst$(yIndex + CurIndex)) + CHR$(34) + " temp.exe > tmp.tmp" SHELL "temp" COLOR 15, 0 PRINT "Press any key to continue ..." a$ = INPUT$(1) GOTO Start Preview: COLOR 7, 0: CLS KillTmp SHELL "COPY " + CHR$(34) + RTRIM$(ScrSaverLst$(yIndex + CurIndex)) + CHR$(34) + " temp.exe > tmp.tmp" SHELL "temp/s" COLOR 15, 0, 0 PRINT "Press any key to continue ..." a$ = INPUT$(1) GOTO Start SUB DrwBox (x1, y1, x2, y2, Style, colour, BgrColour) SELECT CASE Style CASE 1 TopLeft = 201 TopRight = 187 BottomLeft = 200 BottomRight = 188 Vertical = 186 Horizontal = 205 InnerBox = 0 CASE 2 TopLeft = 218 TopRight = 191 BottomLeft = 192 BottomRight = 217 Vertical = 179 Horizontal = 196 InnerBox = 0 END SELECT COLOR colour, BgrColour LOCATE y1, x1: PRINT CHR$(TopLeft) FOR y = y1 + 1 TO y2 - 1 LOCATE y, x1: PRINT CHR$(Vertical) NEXT y LOCATE y2, x1: PRINT CHR$(BottomLeft) FOR x = x1 + 1 TO x2 - 1 LOCATE y1, x: PRINT CHR$(Horizontal) FOR y = y1 + 1 TO y2 - 1 LOCATE y, x: PRINT CHR$(InnerBox) NEXT y LOCATE y2, x: PRINT CHR$(Horizontal) NEXT x LOCATE y1, x2: PRINT CHR$(TopRight) FOR y = y1 + 1 TO y2 - 1 LOCATE y, x2: PRINT CHR$(Vertical) NEXT y LOCATE y2, x2: PRINT CHR$(BottomRight) COLOR 7, 0, 0 END SUB SUB KillTmp SHELL "Dir temp.exe/b/l > tmp.tmp" OPEN "tmp.tmp" FOR INPUT AS #1 DO WHILE NOT EOF(1) INPUT #1, a$ IF a$ = "temp.exe" THEN GOTO KillFile LOOP CLOSE #1 EXIT SUB KillFile: KILL "Temp.exe" CLOSE #1 END SUB SUB PrintCentre (Text$, y, colour, BgrColour) COLOR colour, BgrColour LOCATE y, 40 - (LEN(Text$) / 2): PRINT Text$ COLOR 7, 0 END SUB SUB PrintLst (Method) SELECT CASE Method CASE 0 'Initialize COLOR 14, 1 FOR y = 1 TO MaxLine LOCATE y + 1, 2: PRINT ScrSaverLst$(yIndex + y) NEXT y COLOR 14, 4 LOCATE CurIndex + 1, 2: PRINT ScrSaverLst$(CurIndex + yIndex) CASE 1 'Down OldIndex = CurIndex OldyIndex = yIndex CurIndex = CurIndex + 1 IF CurIndex = MaxLine + 1 THEN CurIndex = CurIndex - 1: yIndex = yIndex + 1 IF yIndex = ScrSaverMax - CurIndex THEN yIndex = yIndex - 1 IF OldIndex = CurIndex AND OldyIndex = yIndex THEN SOUND 2000, .2: EXIT SUB IF yIndex <> OldyIndex THEN COLOR 14, 1 FOR i = 1 TO MaxLine IF i = CurIndex THEN COLOR 14, 4 ELSE COLOR 14, 1 LOCATE i + 1, 2: PRINT ScrSaverLst$(yIndex + i) NEXT i ELSE COLOR 14, 1 LOCATE OldIndex + 1, 2: PRINT ScrSaverLst$(yIndex + OldIndex) COLOR 14, 4 LOCATE CurIndex + 1, 2: PRINT ScrSaverLst$(yIndex + CurIndex) END IF CASE -1 'Down OldIndex = CurIndex OldyIndex = yIndex CurIndex = CurIndex - 1 IF CurIndex = 0 THEN CurIndex = CurIndex + 1: yIndex = yIndex - 1 IF yIndex = -1 THEN yIndex = yIndex + 1 IF OldIndex = CurIndex AND OldyIndex = yIndex THEN SOUND 2000, .2: EXIT SUB IF yIndex <> OldyIndex THEN COLOR 14, 1 FOR i = 1 TO MaxLine IF i = CurIndex THEN COLOR 14, 4 ELSE COLOR 14, 1 LOCATE i + 1, 2: PRINT ScrSaverLst$(yIndex + i) NEXT i ELSE COLOR 14, 1 LOCATE OldIndex + 1, 2: PRINT ScrSaverLst$(yIndex + OldIndex) COLOR 14, 4 LOCATE CurIndex + 1, 2: PRINT ScrSaverLst$(yIndex + CurIndex) END IF END SELECT COLOR 7, 0, 0 END SUB