DECLARE SUB setuppointers
(mousefile$
, mousefile2$
) DECLARE SUB drw3Dbox
(X1%
, Y1%
, X2%
, Y2%
, col1%
, col2%
)
CONST true
= 1, false
= 0 ' real logic CONST maxwins
= 30 ' always +2 more then actual value CONST stfile$
= "SHELL.XSF" ' first ran script file
DIM SHARED flags1%
(1 TO maxwins
), flags2%
(1 TO maxwins
), flags3%
(1 TO maxwins
)
objectID
AS INTEGER ' ID of window environment closebtn
AS INTEGER ' window close button truth resizebtn
AS INTEGER ' window resize button truth movebtn
AS INTEGER ' window titlebar show truth virtual
AS INTEGER ' window virtual screen pointer to XMS
startup
homedir$ = CURDIR$
switch = true
startscript stfile$, ""
PANIC stfile$ + " main script not found."
MOUSESTATUS x%, y%, b%
scrshot
IF refreshwindows
= false
AND openwins
<> false
THEN activewin = win(openwins).objectID
X1 = win(openwins).X1 + 2: Y1 = win(openwins).Y1 + 2
X2 = win(openwins).X2 - 2: Y2 = win(openwins).Y2 - 2
IF win
(openwins
).movebtn
THEN Y1
= Y1
+ 18 IF win
(openwins
).resizebtn
THEN X2
= X2
- 19: Y2
= Y2
- 19 a$ = readline$(IP(activewin), activewin)
derror = false
p$ = pstack$(activewin)
pstack$
(activewin
) = LEFT$(pstack$
(activewin
), LEN(pstack$
(activewin
)) - LEN(p$
) - 1) pstack$
(activewin
) = pstack$
(activewin
) + "." + LTRIM$(STR$(IP
(activewin
))) h% = XMSSCREENGET%
e% = XMSSCREENPUT%(h%)
e% = XMSFREE%(h%)
PANIC p$
'SETVIEW X1, Y1, X2, Y2
winvsave openwins
'SETVIEW 0, 0, maxx, maxy
dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
win
(openwins
).X1
= VAL(a1$
): win
(openwins
).Y1
= VAL(a2$
) win
(openwins
).X2
= VAL(a3$
): win
(openwins
).Y2
= VAL(a4$
) IF win
(openwins
).X2
> maxx
THEN win
(openwins
).X2
= maxx
IF win
(openwins
).Y2
> maxy
THEN win
(openwins
).Y2
= maxy
refreshwindows = true
repair = true
IF a$
= "S-" THEN switch
= false
IF a$
= "S+" THEN switch
= true
putvar p$
, STR$(repair
), activewin
repair = false
chbcolor bgcolor
refreshwindows = true
repair = true
chnonactcol nonactcolor
refreshwindows = true
repair = true
chactcol actcolor
refreshwindows = true
repair = true
fontload p$
sfon$ = p$
PRINT #FL
, "SYSTEM FONT " + p$: KL
= true
refreshwindows = true
repair = true
PRINT #FL
, "TITLE COLOR " + p$: KL
= true
refreshwindows = true
repair = true
background p$ + "~"
chwallpaper p$
win(openwins).title = p$
window.
paint win
(openwins
).X1
, win
(openwins
).Y1
, win
(openwins
).X2
, win
(openwins
).Y2
, win
(openwins
).closebtn
, win
(openwins
).resizebtn
, win
(openwins
).movebtn
, CHR$(3) + p$
, true
putvar a1$
, STR$(GETPOINT%
(VAL(a2$
) + X1
, VAL(a3$
) + Y1
)), activewin
'SETVIEW X1, Y1, X2, Y2
'SETVIEW 0, 0, maxx, maxy
dummy%
= XMSFREE%
(VAL(p$
)) a4$ = getvar$(a4$, activewin)
'SETVIEW X1, Y1, X2, Y2
dummy%
= XMSBLKPUT%
(VAL(a3$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a4$
)) 'SETVIEW 0, 0, maxx, maxy
putvar a1$
, STR$(XMSBLKGET%
(VAL(a2$
) + X1
, VAL(a3$
) + Y1
, VAL(a4$
) + X1
, VAL(a5$
) + Y1
)), activewin
putvar p$, pcommand$(activewin), activewin
setpoi p$, mousepointer$
f$ = DIR$(s$)
'f$ = DIR$
putvar p$
, STR$(activewin
), activewin
putvar d$
, STR$(VAL(s$
)), activewin
putvar d$
, STR$(sfonx%
), activewin
putvar s$
, STR$(sfony%
), activewin
putvar d$
, STR$(maxx
), activewin
putvar s$
, STR$(maxy
), activewin
putvar d$, f$, activewin
putvar d$, f$, activewin
m$
= MID$(pfiles$
(activewin
), FF
) IF pfiles$
(activewin
) <> "" THEN IF ASC(m$
) = f
THEN pfiles$
(activewin
) = LEFT$(pfiles$
(activewin
), FF
- 1) + MID$(pfiles$
(activewin
), FF
+ 1) 'JOYSTICKINFO jax%, jay%, jab%, jbx%, jby%, jbb%
putvar a1$
, STR$(jax%
), activewin
putvar a2$
, STR$(jay%
), activewin
putvar a3$
, STR$(jab%
), activewin
putvar a4$
, STR$(jbx%
), activewin
putvar a5$
, STR$(jby%
), activewin
putvar a6$
, STR$(jbb%
), activewin
pfiles$
(activewin
) = CHR$(VAL(a3$
)) putvar d$
, OCT$(VAL(s$
)), activewin
putvar d$
, HEX$(VAL(s$
)), activewin
putvar d$
, STR$(LEN(s$
)), activewin
putvar d$
, LCASE$(s$
), activewin
putvar d$
, UCASE$(s$
), activewin
putvar a1$, g$, activewin
putvar a1$
, LEFT$(a2$
, VAL(a3$
)), activewin
putvar d$
, RTRIM$(s$
), activewin
putvar d$
, LTRIM$(s$
), activewin
putvar d$
, CHR$(VAL(s$
)), activewin
IF DIR$
(d$
) <> "" THEN putvar s$
, STR$(true
), activewin
ELSE putvar s$
, STR$(false
), activewin
putvar p$, CURDIR$, activewin
'CHDRIVE p$
winvsave openwins
startscript d$, s$
derror(activewin) = 53
putvar s$
, STR$(derror
(activewin
)), activewin
putvar s$
, STR$(derror
(activewin
)), activewin
putvar s$
, STR$(derror
(activewin
)), activewin
dummy% = PNGGETINFO%(a4$, x%, y%)
putvar a1$
, STR$(x%
), activewin: putvar a2$
, STR$(y%
), activewin
putvar a3$
, STR$(cols%
), activewin
'SETVIEW X1, Y1, X2, Y2
dummy%
= PNGMAKE%
(VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a3$
) + X1
, VAL(a4$
) + Y1
, a5$
) 'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
dummy%
= PNGPUT%
(VAL(a1$
) + X1
, VAL(a2$
) + Y1
, a3$
) 'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
DRWFILLCIRCLE
VAL(a5$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a3$
) 'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
DRWPOINT
VAL(a4$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
DRWFILLBOX
VAL(a6$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a3$
) + X1
, VAL(a4$
) + Y1
'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
DRWBOX
VAL(a6$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a3$
) + X1
, VAL(a4$
) + Y1
'SETVIEW 0, 0, maxx, maxy
'SETVIEW X1, Y1, X2, Y2
DRWLINE
VAL(a6$
), VAL(a1$
) + X1
, VAL(a2$
) + Y1
, VAL(a3$
) + X1
, VAL(a4$
) + Y1
'SETVIEW 0, 0, maxx, maxy
putvar d$
, STR$(X2
- X1
), activewin: putvar s$
, STR$(Y2
- Y1
), activewin
MOUSESTATUS x%
, y%
, b%: putvar a1$
, STR$(x%
), activewin
putvar a2$
, STR$(y%
), activewin: putvar a3$
, STR$(b%
), activewin
MOUSESTATUS x%
, y%
, b%: putvar a1$
, STR$(x%
- X1
), activewin
putvar a2$
, STR$(y%
- Y1
), activewin: putvar a3$
, STR$(b%
), activewin
putvar p$, s$, activewin
putvar d$
, STR$(vtx%
(activewin
)), activewin: putvar s$
, STR$(vty%
(activewin
)), activewin
vtx%
(activewin
) = VAL(d$
): vty%
(activewin
) = VAL(s$
) p$
= LTRIM$(MID$(a$
, 2)): putvar p$
, STR$(VAL(getvar$
(p$
, activewin
)) - 1), activewin
p$
= LTRIM$(MID$(a$
, 2)): putvar p$
, STR$(VAL(getvar$
(p$
, activewin
)) + 1), activewin
putvar d$
, STR$(FIX(VAL(getvar$
(s$
, activewin
)))), activewin
putvar d$
, STR$(VAL(getvar$
(d$
, activewin
)) - VAL(s$
)), activewin
putvar d$
, STR$(VAL(getvar$
(d$
, activewin
)) + VAL(s$
)), activewin
s$ = getvar$(s$, activewin)
putvar d$, getvar$(d$, activewin) + s$, activewin
putvar d$, getvar$(d$, activewin) + s$, activewin
'SETVIEW X1, Y1, X2, Y2
DRWSTRING co1%
(activewin
), co2%
(activewin
), a1$
, X1
+ VAL(a3$
), Y1
+ VAL(a4$
) 'SETVIEW 0, 0, maxx, maxy
fontnormal
IF RIGHT$(d$
, 1) = "%" THEN d$
= getvar$
(d$
, activewin
): s
= false
IF RIGHT$(d$
, 1) = "$" THEN d$
= getvar$
(d$
, activewin
): s
= true
flags1%(activewin) = false
IF s$
= d$
THEN flags1%
(activewin
) = 1 flags2%(activewin) = false
flags3%(activewin) = false
co1%
(activewin
) = VAL(d$
): co2%
(activewin
) = VAL(s$
) putvar d$, s$, activewin
k = false
k = true
k = false
k = true
jump:
IP
(activewin
) = VAL(label$
) - 2 done:
IP(activewin) = IP(activewin) + 1
printf: ' print text into window as if it was a text mode screen
vty%(activewin) = vty%(activewin) + 1
vtx%(activewin) = 0
IF sfony%
+ 1 + vty%
(activewin
) * sfony%
> Y2
- Y1
THEN GOSUB scrollf: vty%
(activewin
) = vty%
(activewin
) - 1 vtx%(activewin) = vtx%(activewin) - 1
x% = X1 + vtx%(activewin) * sfonx%: y% = Y1 + vty%(activewin) * sfony%
DRWSTRING co1%(activewin), co2%(activewin), " ", x%, y%
IF sfonx%
+ vtx%
(activewin
) * sfonx%
> X2
- X1
THEN vty%(activewin) = vty%(activewin) + 1
vtx%(activewin) = 0
IF sfony%
+ 1 + vty%
(activewin
) * sfony%
> Y2
- Y1
THEN GOSUB scrollf: vty%
(activewin
) = vty%
(activewin
) - 1 IF sfonx%
+ vtx%
(activewin
) * sfonx%
> X2
- X1
THEN vtx%
(activewin
) = 0 IF sfony%
+ 1 + vty%
(activewin
) * sfony%
> Y2
- Y1
THEN vty%
(activewin
) = 0 x% = X1 + vtx%(activewin) * sfonx%: y% = Y1 + vty%(activewin) * sfony%
DRWSTRING co1%(activewin), co2%(activewin), q$, x%, y%
vtx%(activewin) = vtx%(activewin) + 1
scrollf: ' scroll text in window
scroll% = XMSBLKGET%(X1, Y1 + sfony%, X2, Y2)
dummy% = XMSBLKPUT%(1, X1, Y1, scroll%)
DRWFILLBOX co2%(activewin), X1, Y2 - sfony%, X2, Y2
dummy% = XMSFREE%(scroll%)
errhandler:
REM I had way too much caffeine
while programming this
, hahahaha!!!
SUB background
(wallpaper$
) wallpaper$
= LEFT$(wallpaper$
, LEN(wallpaper$
) - 1) mm = true
IF mm
= true
THEN timerset true
refreshwindows = true
IF openwins
THEN winvsave openwins
FILLSCREEN bgcolor
IF DIR$
(wallpaper$
) <> "" THEN redo3:
a% = PNGPUT%(xx%, yy%, wallpaper$)
a% = PNGGETINFO%(wallpaper$, x%, y%)
IF bghandle%
<> false
THEN dummy%
= XMSFREE%
(bghandle%
) bghandle% = XMSBLKGET%(0, 0, maxx, maxy)
timerset false
'FONTSET fon
IF sfon$
<> "" THEN fontload sfon$
ELSE FONTSYSTEM
a$ = mainmem$(pid)
getvar$ = b$
SUB putvar
(varname$
, contents$
, pid
) a$ = mainmem$(pid)
b$
= LEFT$(a$
, a
- 1) + varname$
+ "," + contents$
mainmem$(pid) = b$
a$ = mainmem$(pid)
dummy% = XMSFREE%(bghandle%)
bgcolor = 25
IF WHICHXMS
(MEM%
, handles%
) = true
THEN PANIC "no free XMS memory"
PANIC "HIMEM.SYS must be loaded first"
IF DIR$
("SETTINGS.INI") <> "" THEN mousefile$
= MID$(settings$
, 15) mousefile2$
= MID$(settings$
, 13) IF LEFT$(settings$
, 10) = "WALLPAPER " THEN wallpaper$
= MID$(settings$
, 11) Mode$ = "640X480"
mousefile$ = "mouse.poi"
setuppointers mousefile$, mousefile2$
cardtype = WHICHVGA
PANIC "No mouse driver found"
CASE "640X400": errorcheck
= RES640L: maxx
= 639: maxy
= 399 CASE "640X480": errorcheck
= RES640: maxx
= 639: maxy
= 479 CASE "800X600": errorcheck
= RES800: maxx
= 799: maxy
= 599 CASE "1024X768": errorcheck
= RES1024: maxx
= 1023: maxy
= 767 CASE "1280X1024": errorcheck
= RES1280: maxx
= 1279: maxy
= 1023 PANIC "Video card can't use this screen mode in SETTINGS.INI"
dummy% = PAGEACTIVE%(1)
FILLPAGE 24
f$ = "XGUI4.INI"
a% = PNGGETINFO%(f$, xe%, ye%)
xe% = xe% / 2: ye% = ye% / 2
a% = PNGPUT%(-xe% + maxx / 2, -ye% + maxy / 2, f$)
dummy% = PAGEACTIVE%(0)
dummy% = PAGEDISPLAY%(0, 0, 1)
background wallpaper$
FONTSYSTEM
fontload sfon$
FONTGETINFO sfonx%, sfony%
dummy% = PAGEDISPLAY%(0, 0, 0)
'MOUSEENTER
MOUSELOCSET 16, 16
timerset true
SUB startscript
(FileName$
, cmd$
) 'ON LOCAL ERROR GOTO sse
timerset true
INPUT #FF
, X1
, Y1
, X2
, Y2
, closebtn
, resizebtn
, movebtn
, title$
process
= window.create
(X1
, Y1
, X2
, Y2
, closebtn
, resizebtn
, movebtn
, title$
) l = l + 1
mainmem$
(process
) = mainmem$
(process
) + CHR$(255) IP(process) = 1 'set instruction pointer to first line...
vtx%(process) = 0 'set virtual text cursor x
vty%(process) = 0 'set virtual text cursor y
co1%(process) = 0 'set color x, to 0
co2%(process) = 7 'set color ,x to 7
pcommand$(process) = cmd$
timerset false
sse:
ssee:
timerset false
mainmem$(win(id%).objectID) = ""
a$ = pfiles$(win(id%).objectID)
pfiles$(win(id%).objectID) = ""
'SETVIEW win(id%).X1, win(id%).Y1, win(id%).X2, win(id%).Y2
dummy% = XMSBLKPUT%(1, 0, 0, bghandle%)
'SETVIEW 0, 0, maxx, maxy
dummy% = XMSFREE%(win(id%).virtual)
FOR c
= id%
TO maxwins
- 1 '*rollback* function #2 win(c).X1 = win(c + 1).X1: win(c).Y1 = win(c + 1).Y1
win(c).X2 = win(c + 1).X2: win(c).Y2 = win(c + 1).Y2
win(c).closebtn = win(c + 1).closebtn: win(c).resizebtn = win(c + 1).resizebtn
win(c).movebtn = win(c + 1).movebtn: win(c).title$ = win(c + 1).title$
win(c).virtual = win(c + 1).virtual: win(c).objectID = win(c + 1).objectID
openwins = openwins - 1
refreshwindows = true
switch = true
FUNCTION window.create
(X1
, Y1
, X2
, Y2
, closebtn
, resizebtn
, movebtn
, title$
) IF Y2
= 5000 THEN Y1
= maxy
/ 2: Y2
= maxy
'*little internal hack 4 shell :) IF win
(i
).objectID
= false
THEN win(i).X1 = X1: win(i).X2 = X2
win(i).Y1 = Y1: win(i).Y2 = Y2
win(i).closebtn = closebtn
win(i).resizebtn = resizebtn
win(i).movebtn = movebtn
win(i).title$ = title$
n:
openwins = openwins + 1
refreshwindows = true
repair = true
MOUSESTATUS x%, y%, b%
IF b%
<> false
AND refreshwindows
= false
THEN 'if mouse is in another window and pressed, set active
IF x%
>= win
(i
).X1
AND y%
>= win
(i
).Y1
AND x%
<= win
(i
).X2
AND y%
<= win
(i
).Y2
THEN FOR Z
= 1 TO openwins
- 1 IF x%
>= win
(Z
).X1
AND y%
>= win
(Z
).Y1
AND x%
<= win
(Z
).X2
AND y%
<= win
(Z
).Y2
THEN newactwin = Z ' sets this for next routines below
IF newactwin
<> false
AND refreshwindows
= false
THEN ' set to new active window
winvsave openwins
win(i).X1 = win(newactwin).X1: win(i).X2 = win(newactwin).X2
win(i).Y1 = win(newactwin).Y1: win(i).Y2 = win(newactwin).Y2
win(i).closebtn = win(newactwin).closebtn
win(i).resizebtn = win(newactwin).resizebtn
win(i).movebtn = win(newactwin).movebtn
win(i).title$ = win(newactwin).title$
win(i).virtual = win(newactwin).virtual
win(i).objectID = win(newactwin).objectID
FOR c
= newactwin
TO maxwins
- 1 '*rollback routine* win(c).X1 = win(c + 1).X1: win(c).Y1 = win(c + 1).Y1
win(c).X2 = win(c + 1).X2: win(c).Y2 = win(c + 1).Y2
win(c).closebtn = win(c + 1).closebtn: win(c).resizebtn = win(c + 1).resizebtn
win(c).movebtn = win(c + 1).movebtn: win(c).title$ = win(c + 1).title$
win(c).virtual = win(c + 1).virtual: win(c).objectID = win(c + 1).objectID
refreshwindows = true
SOUND 700, .6 ' window switch = false so just beep.. MOUSESTATUS x%, y%, b%
IF refreshwindows
= true
THEN 'refresh windows (duh) refreshwindows = false
hidegraph true
dummy% = XMSBLKPUT%(1, 0, 0, bghandle%)
IF win
(i
).objectID
<> false
THEN IF crhandle%
<> false
THEN dummy%
= XMSFREE%
(crhandle%
) crhandle% = XMSBLKGET%(0, 0, maxx, maxy)
window.
paint win
(i
).X1
, win
(i
).Y1
, win
(i
).X2
, win
(i
).Y2
, win
(i
).closebtn
, win
(i
).resizebtn
, win
(i
).movebtn
, win
(i
).title$
, a%
IF win
(i
).virtual
<> false
THEN Y1 = win(i).Y1: X1 = win(i).X1: Y2 = win(i).Y2: X2 = win(i).X2
IF win
(i
).movebtn
THEN Y1
= Y1
+ 18 IF win
(i
).resizebtn
THEN X2
= X2
- 19: Y2
= Y2
- 19 'SETVIEW X1, Y1, X2 - 2, Y2 - 2
winvput i 'put windows contents back into the window :)
'SETVIEW 0, 0, maxx, maxy
hidegraph false
i = openwins
IF b%
<> false
AND refreshwindows
= false
THEN IF win
(i
).resizebtn
<> false
AND x%
>= win
(i
).X2
- 19 AND y%
>= win
(i
).Y2
- 19 AND x%
<= win
(i
).X2
AND y%
<= win
(i
).Y2
THEN xl = x% - win(i).X1: yl = y% - win(i).Y1
'SETVIEW win(i).X1, win(i).Y1, win(i).X2, win(i).Y2
winvsave i
hidegraph true
dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
'SETVIEW 0, 0, maxx, maxy
MOUSESTATUS x%, y%, b%
x3 = win(i).X1: y3 = win(i).Y1
x4 = x% + (win(i).X2 - win(i).X1) - xl: y4 = y% + (win(i).Y2 - win(i).Y1) - yl
IF x4
<= x3
+ 70 THEN x4
= x3
+ 70 IF y4
<= y3
+ 70 THEN y4
= y3
+ 70 handle2% = XMSBLKGET%(x3, y3, x4, y4)
window.
paint x3
+ 0, y3
+ 0, x4
+ 0, y4
+ 0, win
(i
).closebtn
, true
, win
(i
).movebtn
, win
(i
).title
, true
drw3Dbox x4 - 19, y4 - 19, x4 - 2, y4 - 2, 0, actcolor + 0
'SETVIEW x3, y3, x4 - 21, y4 - 21
winvput i
'SETVIEW 0, 0, maxx, maxy
MOUSESTATUS xx%, yy%, bb%
hidegraph false
MOUSESTATUS x%, y%, b%
hidegraph true
dummy% = XMSBLKPUT%(1, x3, y3, handle2%)
e: 'Hidden deep inside your code you may find yourself
dummy% = XMSFREE%(handle2%)
refreshwindows = true
win(i).X2 = x4: win(i).Y2 = y4
repair = true
winvsave i
IF win
(i
).closebtn
<> false
THEN f
= 20 IF win
(i
).movebtn
<> false
AND x%
>= win
(i
).X1
AND y%
>= win
(i
).Y1
AND x%
<= win
(i
).X2
- f
AND y%
<= win
(i
).Y1
+ 18 THEN xl = x% - win(i).X1: yl = y% - win(i).Y1
handle% = XMSBLKGET%(win(i).X1, win(i).Y1, win(i).X2, win(i).Y2)
'SETVIEW win(i).X1, win(i).Y1, win(i).X2, win(i).Y2
winvsave i
hidegraph true
dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
'SETVIEW 0, 0, maxx, maxy
MOUSESTATUS x%, y%, b%
x3 = x% - xl: y3 = y% - yl
x4 = x% + (win(i).X2 - win(i).X1) - xl: y4 = y% + (win(i).Y2 - win(i).Y1) - yl
IF x3
< 0 THEN x3
= 0: x4
= win
(i
).X2
- win
(i
).X1
IF y3
< 0 THEN y3
= 0: y4
= win
(i
).Y2
- win
(i
).Y1
IF x4
> maxx
THEN x4
= maxx: x3
= x4
- (win
(i
).X2
- win
(i
).X1
) IF y4
> maxy
THEN y4
= maxy: y3
= y4
- (win
(i
).Y2
- win
(i
).Y1
) handle2% = XMSBLKGET%(x3, y3, x4, y4)
dummy% = XMSBLKPUT%(1, x3, y3, handle%)
hidegraph false
MOUSESTATUS xx%, yy%, bb%
MOUSESTATUS x%, y%, b%
E2:
hidegraph true
dummy% = XMSBLKPUT%(1, x3, y3, handle2%)
dummy% = XMSFREE%(handle2%)
dummy% = XMSBLKPUT%(1, x3, y3, handle%)
hidegraph false
dummy% = XMSFREE%(handle%)
win(i).X1 = x3: win(i).Y1 = y3: win(i).X2 = x4: win(i).Y2 = y4
refreshwindows = true
IF win
(i
).closebtn
<> false
AND win
(i
).movebtn
<> false
AND x%
>= win
(i
).X2
- 19 AND x%
<= win
(i
).X2
- 2 AND y%
>= win
(i
).Y1
+ 2 AND y%
<= win
(i
).Y1
+ 18 THEN DRWBOX 0, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 1, win(i).Y1 + 18
MOUSESTATUS x%, y%, b%
DRWLINE 15, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 19, win(i).Y1 + 17
DRWLINE 15, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 2, win(i).Y1 + 1
IF x%
>= win
(i
).X2
- 19 AND x%
<= win
(i
).X2
- 2 AND y%
>= win
(i
).Y1
+ 2 AND y%
<= win
(i
).Y1
+ 18 THEN
SUB window.
paint (X1%
, Y1%
, X2%
, Y2%
, closebtn%
, resizebtn%
, movebtn%
, title$
, active%
) 'kenneths ripoff of the Amiga look >:)
DRWBOX 0, X1%, Y1%, X2%, Y2%
DRWBOX 0, X1%, Y1%, X2% - 1, Y2% - 1
DRWBOX 15, X1% + 1, Y1% + 1, X2% - 2, Y2% - 2
DRWFILLBOX 7, X1% + 2, Y1% + 2, X2% - 2, Y2% - 2
DRWLINE 0, X1% + 1, Y1% + 18, X2% - 2, Y1% + 18
DRWLINE 15, X1% + 1, Y1% + 19, X2% - 2, Y1% + 19
a = actcolor
a = nonactcolor
DRWFILLBOX a, X1% + 2, Y1% + 2, X2% - 2, Y1% + 17
DRWLINE 15, X2% - 19, Y1% + 2, X2% - 19, Y1% + 17
DRWLINE 0, X2% - 20, Y1% + 2, X2% - 20, Y1% + 17
DRWBOX 0, X2% - 13, Y1% + 7, X2% - 8, Y1% + 12
DRWLINE 15, X2% - 12, Y1% + 12, X2% - 8, Y1% + 12
DRWLINE 15, X2% - 8, Y1% + 8, X2% - 8, Y1% + 12
b = 19
l%
= ((X2%
- X1%
) / 2) - LEN(t$
) * 4 'SETVIEW X1% + 2, Y1% + 3, X2% - 3 - b, Y1% + 17
DRWSTRING titlecolor, a, t$, X1% + 2 + l%, Y1% + 3
'SETVIEW 0, 0, maxx, maxy
DRWFILLBOX a, X2% - 18, Y2% - 18, X2% - 2, Y2% - 2
DRWBOX 0, X2% - 16, Y2% - 15, X2% - 12, Y2% - 11
DRWBOX 15, X2% - 16, Y2% - 15, X2% - 11, Y2% - 10
DRWBOX 0, X2% - 17, Y2% - 16, X2% - 5, Y2% - 5
DRWBOX 15, X2% - 16, Y2% - 15, X2% - 4, Y2% - 4
DRWLINE 15, X2% - 19, Y2% - 19, X2% - 19, Y2% - 2
DRWLINE 15, X2% - 19, Y2% - 19, X2% - 2, Y2% - 19
DRWBOX 0, X2% - 20, Y2% - 20, X2% - 1, Y2% - 1
DRWLINE 0, X2% - 20, Y1% + 20, X2% - 20, Y2% - 21
DRWLINE 0, X1% + 2, Y2% - 20, X2% - 21, Y2% - 20
DRWFILLBOX a, X2% - 19, Y1% + 20, X2% - 2, Y2% - 21
DRWFILLBOX a, X1% + 2, Y2% - 19, X2% - 21, Y2% - 2
X1% = win(id).X1 + 2: Y1% = win(id).Y1% + 2
Y1% = Y1% + 18
dummy% = XMSBLKPUT%(1, X1%, Y1%, win(id).virtual)
IF win
(id
).virtual
<> false
THEN dummy%
= XMSFREE%
(win
(id
).virtual
) X1% = win(id).X1 + 2: Y1% = win(id).Y1% + 2
X2% = win(id).X2 - 2: Y2% = win(id).Y2% - 2
Y1% = Y1% + 18
X2% = X2% - 19
Y2% = Y2% - 19
win(id).virtual = XMSBLKGET%(X1%, Y1%, X2%, Y2%)
PRINT #FL
, "ACTIVE COLOR" + STR$(newcol
): KL
= true
PRINT #FL
, "BACKGROUND COLOR" + STR$(newcol
): KL
= true
PRINT #FL
, "NONACT COLOR" + STR$(newcol
): KL
= true
SUB chwallpaper
(newfile$
) PRINT #FL
, "WALLPAPER " + newfile$: KL
= true
SUB drw3Dbox
(X1%
, Y1%
, X2%
, Y2%
, col1%
, col2%
) DRWLINE col1%, X1%, Y1%, X2%, Y1%
DRWLINE col1%, X1%, Y1%, X1%, Y2%
DRWLINE col2%, X1% + 1, Y2%, X2%, Y2%
DRWLINE col2%, X2%, Y1% + 1, X2%, Y2%
a% = PAGEDISPLAY(0, 0, 0)
h% = XMSSCREENGET%
a% = PAGEACTIVE%(1)
e% = XMSSCREENPUT%(h%)
e% = XMSFREE%(h%)
a% = PAGEACTIVE%(0)
a% = PAGEDISPLAY%(0, 0, 1)
MOUSESTATUS x%, y%, b%
MOUSERANGESET x%, y%, x% + 1, y% + 1
dummy% = PNGMAKE%(0, 0, GETMAXX%, GETMAXY%, "SCRSHOT.PCX")
MOUSERANGESET 0, 0, GETMAXX%, GETMAXY%
startscript "MSGBOX.L", "System Message...:Screen shot was saved as SCRSHOT.PCX"
SUB setpoi
(FileName$
, v$
) char$
= MID$(tempstr$
, i
, 1) newchar$ = newchar$ + char$
vv$
= vv$
+ CHR$(VAL(newchar$
)): newchar$
= "" v$ = vv$
SUB setuppointers
(mousefile$
, mousefile2$
) IF DIR$
(mousefile$
) <> "" THEN setpoi mousefile$, mousepointer$
IF DIR$
(mousefile2$
) <> "" THEN setpoi mousefile2$, mousetimer$
IF DIR$
("SETTINGS.INI") = "" THEN PRINT "Please run SETUP program first" PANIC "Don't directly start X-GUI, please use START"
IF mousetimer$
<> "" THEN MOUSECURSORSET mousetimer$
IF mousepointer$
<> "" THEN MOUSECURSORSET mousepointer$
CONST TmpFile$
= "DIR$INF0.INF", ListMAX%
= 500 'change maximum to suit your needs SHARED DIRCount%
'returns file count if desired STATIC Ready%
, Index%
, DirList$
() IF NOT Ready%
THEN REDIM DirList$
(ListMAX%
): Ready%
= -1 'DIM array first use IF spec$
> "" THEN 'get file names when a spec is given Index%
= 0: DirList$
(Index%
) = "": ff%
= FREEFILE Index% = Index% + 1
DIRCount% = Index% 'SHARED variable can return the file count
ELSE IF Index%
> 0 THEN Index%
= Index%
- 1 'no spec sends next file name DIR$ = DirList$(Index%)
theDisplay.Options.isFullscreen = inFullscreen
theDisplay.Options.isScaled = inScaled
theDisplay.Options.isSmoothed = inSmoothed
theDisplay.Handle
= _NEWIMAGE(theDisplay.sizeX
, theDisplay.sizeY
, 32) theDisplay.Options.isScaled = -1
theDisplay.Options.isSmoothed = -1
IF theDisplay.Options.isScaled
= -1 AND theDisplay.Options.isSmoothed
= -1 THEN theDisplay.Options.isScaled = -1
theDisplay.Options.isSmoothed = 0
IF theDisplay.Options.isScaled
= -1 AND theDisplay.Options.isSmoothed
= 0 THEN theDisplay.Options.isScaled = 0
theDisplay.Options.isSmoothed = -1
IF theDisplay.Options.isScaled
= 0 AND theDisplay.Options.isSmoothed
= -1 THEN theDisplay.Options.isScaled = 0
theDisplay.Options.isSmoothed = 0
IF theDisplay.Options.isScaled
= 0 AND theDisplay.Options.isSmoothed
= 0 THEN RESGRAPHIC~&& = 1
LINE (inX1
, inY1
)-(inX1
+ inX2
, inY1
+ inY2
), inColour
, BF
LINE (inX1
, inY1
)-(inX1
+ inX2
, inY1
+ inY2
), inColour
, B
COLOR inForegroundColor
, inBackgroundColor
PAINT (inXSeed
, inYSeed
), inFillColor
, inBorderColor
PNGGETINFO = 1
_PUTIMAGE , theDisplay.Handle
, Temporary
, (inX1
, inY1
)-(inX2
, inY2
) PNGMAKE = 1
PNGPUT = 1
CIRCLE (inXCenter
, inYCenter
), inRadius
, inColor
DRWCIRCLE inColor, inXCenter, inYCenter, inRadius
FILLAREA inXCenter, inYCenter, inColor, inColor
PSET (inX
, inY
), inColour
LINE (inX1
, inY1
)-(inX2
, inY2
), inColour
'SCREEN 3
RESTEXT = 1
SUB FONTGETINFO
(inWidth
, inHeight
)
MOUSE.Icon = Temporary