home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_GEN
/
FSTICO31.ZIP
/
FAST
/
ICONS
/
ICONS.PRG
< prev
next >
Wrap
Text File
|
1994-03-02
|
16KB
|
792 lines
static color:=0
static colorf:=0
static Mapae:=""
static Mapa:=""
static EventIcon
static nKey:=0
static IconName:="Uno.fic"
Function main()
Local cKey:=""
EventIcon:=array(20,7)
cls
if !rIsMouse()
@ 0,0 say "Mouse Driver not fount..."
quit
endif
Pantalla()
Fondo(15)
Mapae:=Memoread("uno.fic")
SeeIconot()
SeeIconotg()
Color:=15
ColorPixel(Color)
rCursorOn()
Do while .t.
nKey:=rinkey(0)
if nkey=1001
rCursoron()
Opcion()
endif
if nkey=-1
Salvar()
exit
endif
if nkey=27
exit
endif
enddo
rCursorOff()
TxtMode()
return(nil)
Function Opcion()
Local i:=0
Ejecuta:=""
if rInZone(1,102,256,358)
PixelIcono()
endif
if rInZone(1,372,256,412) .and. nkey=1001
ChangColor()
endif
for i:=1 to 20
if Empty(EventIcon[i,1])
i:=20
else
if rInZone(val(EventIcon[i,2]),val(EventIcon[i,3]),val(EventIcon[i,4]),val(EventIcon[i,5]))
if !Empty(EventIcon[i,6])
Ejecuta:="{||"+EventIcon[i,6]+"}";Eval(&Ejecuta)
endif
endif
endif
next
return(nil)
Function PixelIcono()
Local x:=rGetPosX()
Local y:=rGetPosy()
Local xl:=int((x-1)/8)+1
Local yc:=int((y-102)/8)+1
rCursorOff()
GPaintZone(((xl-1)*8)+1,((yc-1)*8)+103,(xl*8)-1,(yc*8)+101,color)
StrSetCar(Mapae,(((yc-1)*32)+xl),color)
SetPixel(xl+300,yc+102,color)
rCursorOn()
return(nil)
Function SeeIconotg()
Local x:=0
Local y:=0
Local p:=0
for x=1 to 32
for y=1 to 32
p:=StrGetCar(Mapae,(((y-1)*32)+x))
GPaintZone(((x-1)*8)+1,((y-1)*8)+103,(x*8)-1,(y*8)+101,p)
next
next
return(nil)
Function seeiconot()
Local x:=301
Local y:=103
Local i:=0
Local i1:=0
Local p:=0
for i:=1 to 32
for i1:=1 to 32
p:=StrGetCar(Mapae,(((i-1)*32)+i1))
SetPixel(x,y,p)
x:=x+1
next
x:=301;y:=y+1
next
return(nil)
Function VerIcono(x,y,nicono,evento,logico)
Local x1:=0
Local y1:=0
Local i:=0
Local i1:=0
Local p:=0
Local cp:=""
Local cp1:=""
x1:=x;y1:=y
RCursoroff()
Mapa:=Memoread(nicono)
for i:=1 to 32
for i1:=1 to 32
p:=StrGetCar(Mapa,(((i-1)*32)+i1))
SetPixel(x,y,p)
x:=x+1
next
x:=x1;y:=y+1
next
if logico=.t.
for i:=1 to 20
if Empty(EventIcon[i,1])
EventIcon[i,1]:=nicono
EventIcon[i,2]:=Str(x1)
EventIcon[i,3]:=Str(y1)
EventIcon[i,4]:=Str(x1+32)
EventIcon[i,5]:=Str(y1+32)
EventIcon[i,6]:=evento
i:=20
endif
next
endif
RcursorOn()
return(nil)
Function Fondo(cf)
Local i:=0
Local i1:=0
Local p:=0
for i:=1 to 32
for i1:=1 to 32
StrSetCar(Mapae,(((i1-1)*32)+i),cf)
next
next
seeiconot()
return(nil)
Function ChangColor()
Local xx:=rGetPosX()
Local yy:=rGetPosy()
Local x:=1
Local y:=372
Local x1:=32
Local y1:=392
Local i:=0
for i=1 to 8
if rInZone(x,y,x1,y1)
color:=i-1
endif
x:=x+32;x1:=x1+32
next
x:=1;y=392;x1:=32;y1:=412
for i=1 to 8
if rInZone(x,y,x1,y1)
color:=i+8-1
endif
x:=x+32;x1:=x1+32
next
ColorPixel(Color)
return(nil)
Function ChangFondo()
Local xx:=rGetPosX()
Local yy:=rGetPosy()
Local x:=1
Local y:=372
Local x1:=32
Local y1:=392
Local i:=0
for i=1 to 8
if rInZone(x,y,x1,y1)
colorf:=(i-1)
endif
x:=x+32;x1:=x1+32
next
x:=1;y=392;x1:=32;y1:=412
for i=1 to 8
if rInZone(x,y,x1,y1)
colorf:=(i+8-1)
endif
x:=x+32;x1:=x1+32
next
fondo(colorf)
ColorFondo(Color)
return(nil)
Function rInZone(zx,zy,zx1,zy1)
Local x:=rGetPosX()
Local y:=rGetPosy()
Local logico:=.t.
if x<zx
logico=.f.
endif
if x>zx1
logico=.f.
endif
if y<zy
logico:=.f.
endif
if y>zy1
logico:=.f.
endif
return(logico)
Function ColorPixel(Color)
GpaintZone(280,372,320,392,Color)
return(nil)
Function ColorFondo(Color)
GpaintZone(280,393,320,412,Color)
return(nil)
Function Pantalla()
Local x:=1
Local y:=102
Local x1:=1
Local y1:=358
Local i:=0
Local i1:=0
color:=0
SetVga()
GpaintZone(0,0,639,479,8)
Gbox(1,1,639,25,7)
Gbox(2,2,638,24,7)
Gbox(3,3,637,23,7)
Gline(4,4,636,4,0)
Gline(636,4,636,22,0)
Gline(5,5,636,5,0)
Gline(635,4,635,22,0)
Gline(6,6,634,6,0)
Gline(634,4,634,21,0)
GpaintZone(7,7,633,22,1)
Dispstr("Fast Icons Editor",232,7,14,1,8)
Gbox(1,30,639,92,7)
Gbox(2,31,638,91,7)
Gbox(3,32,637,90,7)
Gline(4,53,636,53,7)
Gline(4,54,636,54,7)
Gline(4,55,636,55,7)
GpaintZone(8,33,635,52,1)
Gline(9,33,636,33,0)
Gline(635,36,635,52,0)
Gline(9,34,636,34,0)
Gline(634,36,634,52,0)
GpaintZone(9,56,633,89,11)
Dispstr("Exit",12,36,14,1,8)
VerIcono(10,57,"salida.fic","exit()",.t.)
Dispstr("System",55,36,14,1,8)
VerIcono(63,57,"msdos.fic","MsDos()",.t.)
Dispstr("Files",191,36,14,1,8)
VerIcono(120,57,"new.fic","New()",.t.)
VerIcono(154,57,"abrir.fic")
VerIcono(188,57,"salvar.fic","Salvar()",.t.)
VerIcono(222,57,"salvac.fic")
VerIcono(256,57,"borrar.fic")
Dispstr("Works",388,36,14,1,8)
VerIcono(310,57,"cuadro.fic","Cuadro()",.t.)
VerIcono(344,57,"cubos.fic","Cubos()",.t.)
VerIcono(378,57,"circulov.fic")
VerIcono(412,57,"circulor.fic")
VerIcono(446,57,"lineas.fic","Lineas()",.t.)
VerIcono(480,57,"brocha.fic")
Dispstr("About",537,36,14,1,8)
VerIcono(540,57,"fast.fic","About()",.t.)
Dispstr("Help",599,36,14,1,8)
VerIcono(601,57,"help.fic")
Gbox(1,455,639,479,7)
Gbox(2,456,638,478,7)
Gbox(3,457,637,477,7)
GpaintZone(5,458,635,475,1)
gline(16,460,16,475,1)
Dispstr("Name of File : uno.fic",8,460,14,1,8)
Pantalla1()
return(nil)
Function Pantalla1()
Local x:=1
Local y:=102
Local x1:=1
Local y1:=358
Local i:=0
Local i1:=0
color:=0
Gbox(1,102,256,358,7)
for i=1 to 31
x:=x+8;x1:=x1+8
GLine(x,y,x1,y1,7)
next
x:=1;x1=256;y1=102
for i=1 to 31
y:=y+8;y1:=y1+8
GLine(x,y,x1,y1,7)
next
x:=1;y:=372;x1:=32;y1:=392
for i=1 to 8
Gbox(x,y,x1,y1,7)
for i1=1 to 19
GLine(x+1,y+i1,x1-1,y+i1,color)
next
x:=x+32;x1:=x1+32
color:=color+1
next
x:=1;y=392;x1:=32;y1:=412
for i=1 to 8
Gbox(x,y,x1,y1,7)
for i1=1 to 19
GLine(x+1,y+i1,x1-1,y+i1,color)
next
x:=x+32;x1:=x1+32
color:=color+1
next
return(nil)
Function GPaintZone(lx,cx,ly,cy,color)
local bucle,nbuclei,nbuclef,canchoi,canchof
nbuclei=cx;nbuclef=cy
canchoi=lx;canchof=ly
for bucle=nbuclei to nbuclef
GLine(canchoi,bucle,canchof,bucle,color)
next
return(nil)
Function Exit()
nKey:=27
return(nil)
Function MsDos()
rCursoroff()
TxtMode()
cls
? "Type EXIT to return"
DosShell()
pantalla()
rSetPos(1,1)
rCursorOn()
return(nil)
Function New()
Mapae:=space(1024)
rCursorOff()
pantalla1()
Fondo(15)
SeeIconot()
SeeIconotg()
rCursorOn()
return(nil)
Function Salvar()
GpaintZone(5,458,635,475,1)
Dispstr("Saving File...",8,460,14,1,8)
MemoWrit(IconName,Mapae)
GpaintZone(5,458,635,475,1)
Dispstr("Name of File : uno.fic",8,460,14,1,8)
return(nil)
Function About()
rCursorOff()
Gbox(350,150,600,380,7)
Gbox(351,151,599,379,7)
Gbox(352,152,598,378,7)
Gline(353,170,597,170,7)
Gline(353,171,597,171,7)
Gline(353,172,597,172,7)
GpaintZone(354,154,596,169,1)
Dispstr("About",460,154,14,1,8)
GpaintZone(354,175,596,376,15)
Dispstr("Fast Icons Editor",400,185,0,15,8)
Dispstr("Versión : Alfa 1.0",360,215,0,15,8)
Dispstr("Fast Versión : 3.00",360,230,0,15,8)
Dispstr("Created by Yosu Unibaso",360,255,0,15,8)
Dispstr("Fast Library for Clipper",360,285,0,15,8)
Dispstr("is property of Manu Roibal",360,300,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OK",468,340,15,7,8)
rCursorOn()
Do while !rInZone(450,335,500,360)
rInkey(0)
Enddo
rCursorOff()
GpaintZone(350,150,600,400,8)
rCursorOn()
return(nil)
Function cuadro()
Local swc:=0
Local x1:=0
Local y1:=0
Local x2:=0
Local y2:=0
Local swi:=""
Local n1:=0
Local n2:=0
Local i:=0
Local i1:=0
Local x1l:=0
Local y1c:=0
Local x2l:=0
Local y2c:=0
Local xil:=0
Local yic:=0
Local xfl:=0
Local yfc:=0
Local cxy:=array(4,4)
Local p:=0
rCursorOff()
Gbox(350,150,600,380,7)
Gbox(351,151,599,379,7)
Gbox(352,152,598,378,7)
Gline(353,170,597,170,7)
Gline(353,171,597,171,7)
Gline(353,172,597,172,7)
GpaintZone(354,154,596,169,1)
Dispstr("Boxes",435,154,14,1,8)
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the upper left corner of ",360,202,0,15,8)
Dispstr("the box. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do While swc=0
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x1:=rGetPosX();y1:=rGetPosY()
x1l:=int((x1-1)/8)+1
y1c:=int((y1-102)/8)+1
exit
endif
Enddo
if swc=1
exit
endif
rCursorOff()
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the botton right corner ",360,202,0,15,8)
Dispstr("of the box. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x2:=rGetPosX();y2:=rGetPosY()
x2l:=int((x2-1)/8)+1
y2c:=int((y2-102)/8)+1
swc=1;exit
endif
Enddo
Enddo
rCursorOff()
if y1c<y2c
xil:=x1l;yic:=y1c
xfl:=x2l;yfc:=y2c
else
xil:=x2l;yic:=y2c
xfl:=x1l;yfc:=y1c
endif
cxy[1,1]:=xil;cxy[1,2]:=yic;cxy[1,3]:=xfl;cxy[1,4]:=yic
cxy[2,1]:=xfl;cxy[2,2]:=yic;cxy[2,3]:=xfl;cxy[2,4]:=yfc
cxy[3,1]:=xil;cxy[3,2]:=yic;cxy[3,3]:=xil;cxy[3,4]:=yfc
cxy[4,1]:=xil;cxy[4,2]:=yfc;cxy[4,3]:=xfl;cxy[4,4]:=yfc
for i1:=1 to 4
x1l:=cxy[i1,1];y1c:=cxy[i1,2]
x2l:=cxy[i1,3];y2c:=cxy[i1,4]
if x1l=x2l
swi:="x"
endif
if y1c=y2c
swi:="y"
endif
if swi="y"
if x1l<x2l
n1:=x1l;n2:=x2l
else
n1:=x2l;n2:=x1l
endif
for i:=n1 to n2
StrSetCar(Mapae,(((y1c-1)*32)+i),color)
GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
next
endif
if swi="x"
if y1c<y2c
n1:=y1c;n2:=y2c
else
n1:=y2c;n2:=y1c
endif
for i:=n1 to n2
StrSetCar(Mapae,(((i-1)*32)+x1l),color)
GPaintZone(((x1l-1)*8)+1,((i-1)*8)+103,(x1l*8)-1,(i*8)+101,color)
next
endif
next
SeeIconoT()
GpaintZone(350,150,600,400,8)
rCursorOn()
return(nil)
Function cubos()
Local swc:=0
Local x1:=0
Local y1:=0
Local x2:=0
Local y2:=0
Local swi:=""
Local n1:=0
Local n2:=0
Local i:=0
Local i1:=0
Local x1l:=0
Local y1c:=0
Local x2l:=0
Local y2c:=0
Local xil:=0
Local yic:=0
Local xfl:=0
Local yfc:=0
Local cxy:=array(4,4)
Local p:=0
rCursorOff()
Gbox(350,150,600,380,7)
Gbox(351,151,599,379,7)
Gbox(352,152,598,378,7)
Gline(353,170,597,170,7)
Gline(353,171,597,171,7)
Gline(353,172,597,172,7)
GpaintZone(354,154,596,169,1)
Dispstr("Filled boxes",410,154,14,1,8)
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the upper left corner of ",360,202,0,15,8)
Dispstr("the filled box. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do While swc=0
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x1:=rGetPosX();y1:=rGetPosY()
x1l:=int((x1-1)/8)+1
y1c:=int((y1-102)/8)+1
exit
endif
Enddo
if swc=1
exit
endif
rCursorOff()
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the botton right corner ",360,202,0,15,8)
Dispstr("of the filled box. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x2:=rGetPosX();y2:=rGetPosY()
x2l:=int((x2-1)/8)+1
y2c:=int((y2-102)/8)+1
swc=1;exit
endif
Enddo
Enddo
rCursorOff()
if y1c<y2c
xil:=x1l;yic:=y1c
xfl:=x2l;yfc:=y2c
else
xil:=x2l;yic:=y2c
xfl:=x1l;yfc:=y1c
endif
for i1:=yic to yfc
x1l:=xil;y1c:=i1
x2l:=xfl;y2c:=i1
for i:=x1l to x2l
StrSetCar(Mapae,(((y1c-1)*32)+i),color)
GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
next
next
SeeIconoT()
GpaintZone(350,150,600,400,8)
rCursorOn()
return(nil)
Function lineas()
Local swc:=0
Local x1:=0
Local y1:=0
Local x2:=0
Local y2:=0
Local swi:=""
Local n1:=0
Local n2:=0
Local i:=0
Local x1l:=0
Local y1c:=0
Local x2l:=0
Local y2c:=0
Local p:=0
rCursorOff()
Gbox(350,150,600,380,7)
Gbox(351,151,599,379,7)
Gbox(352,152,598,378,7)
Gline(353,170,597,170,7)
Gline(353,171,597,171,7)
Gline(353,172,597,172,7)
GpaintZone(354,154,596,169,1)
Dispstr("Lines",452,154,14,1,8)
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the first point of the ",360,202,0,15,8)
Dispstr("line. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do While swc=0
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x1:=rGetPosX();y1:=rGetPosY()
x1l:=int((x1-1)/8)+1
y1c:=int((y1-102)/8)+1
exit
endif
Enddo
if swc=1
exit
endif
rCursorOff()
GpaintZone(354,175,596,376,15)
Dispstr("Punch with the mouse on ",360,185,0,15,8)
Dispstr("the second point of the ",360,202,0,15,8)
Dispstr("line. ",360,219,0,15,8)
Gbox(450,335,500,360,0)
Gbox(451,336,499,359,0)
Gbox(452,337,498,358,0)
GpaintZone(453,338,497,357,7)
Dispstr("OUT",463,340,15,7,8)
rCursorOn()
Do while .t.
rInkey(0)
if rInZone(450,335,500,360)
swc=1
exit
endif
if rInZone(1,102,256,358)
x2:=rGetPosX();y2:=rGetPosY()
x2l:=int((x2-1)/8)+1
y2c:=int((y2-102)/8)+1
if x1l=x2l
swi:="x";swc=1;exit
endif
if y1c=y2c
swi:="y";swc=1;exit
endif
endif
Enddo
Enddo
rCursorOff()
if swi="y"
if x1l<x2l
n1:=x1l;n2:=x2l
else
n1:=x2l;n2:=x1l
endif
for i:=n1 to n2
StrSetCar(Mapae,(((y1c-1)*32)+i),color)
GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
next
endif
if swi="x"
if y1c<y2c
n1:=y1c;n2:=y2c
else
n1:=y2c;n2:=y1c
endif
for i:=n1 to n2
StrSetCar(Mapae,(((i-1)*32)+x1l),color)
GPaintZone(((x1l-1)*8)+1,((i-1)*8)+103,(x1l*8)-1,(i*8)+101,color)
next
endif
SeeIconoT()
GpaintZone(350,150,600,400,8)
rCursorOn()
return(nil)