home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / GRAFX / FSTICO31.ZIP / FAST / ICONS / ICONS.PRG < prev    next >
Text File  |  1994-03-02  |  16KB  |  792 lines

  1. static color:=0
  2. static colorf:=0
  3. static Mapae:=""
  4. static Mapa:=""
  5. static EventIcon
  6. static nKey:=0
  7. static IconName:="Uno.fic"
  8.  
  9. Function main()
  10. Local cKey:=""
  11. EventIcon:=array(20,7)
  12. cls
  13. if !rIsMouse()
  14.    @ 0,0 say "Mouse Driver not fount..."
  15.    quit
  16. endif
  17. Pantalla()
  18. Fondo(15)
  19. Mapae:=Memoread("uno.fic")
  20. SeeIconot()
  21. SeeIconotg()
  22. Color:=15
  23. ColorPixel(Color)
  24. rCursorOn()
  25. Do while .t.
  26.    nKey:=rinkey(0)
  27.    if nkey=1001
  28.       rCursoron()
  29.       Opcion()
  30.    endif
  31.    if nkey=-1
  32.       Salvar()
  33.       exit
  34.    endif
  35.    if nkey=27
  36.       exit
  37.    endif
  38. enddo
  39. rCursorOff()
  40. TxtMode()
  41. return(nil)
  42.  
  43.  
  44.  
  45. Function Opcion()
  46. Local i:=0
  47. Ejecuta:=""
  48. if rInZone(1,102,256,358)
  49.    PixelIcono()
  50. endif
  51. if rInZone(1,372,256,412) .and. nkey=1001
  52.    ChangColor()
  53. endif
  54. for i:=1 to 20
  55.     if Empty(EventIcon[i,1])
  56.        i:=20
  57.     else
  58.        if rInZone(val(EventIcon[i,2]),val(EventIcon[i,3]),val(EventIcon[i,4]),val(EventIcon[i,5]))
  59.           if !Empty(EventIcon[i,6])
  60.              Ejecuta:="{||"+EventIcon[i,6]+"}";Eval(&Ejecuta)
  61.           endif
  62.        endif
  63.     endif
  64. next
  65. return(nil)
  66.  
  67.  
  68.  
  69. Function PixelIcono()
  70. Local x:=rGetPosX()
  71. Local y:=rGetPosy()
  72. Local xl:=int((x-1)/8)+1
  73. Local yc:=int((y-102)/8)+1
  74. rCursorOff()
  75. GPaintZone(((xl-1)*8)+1,((yc-1)*8)+103,(xl*8)-1,(yc*8)+101,color)
  76. StrSetCar(Mapae,(((yc-1)*32)+xl),color)
  77. SetPixel(xl+300,yc+102,color)
  78. rCursorOn()
  79. return(nil)
  80.  
  81.  
  82.  
  83. Function SeeIconotg()
  84. Local x:=0
  85. Local y:=0
  86. Local p:=0
  87. for x=1 to 32
  88.     for y=1 to 32
  89.         p:=StrGetCar(Mapae,(((y-1)*32)+x))
  90.         GPaintZone(((x-1)*8)+1,((y-1)*8)+103,(x*8)-1,(y*8)+101,p)
  91.     next
  92. next
  93. return(nil)
  94.  
  95.  
  96.  
  97. Function seeiconot()
  98. Local x:=301
  99. Local y:=103
  100. Local i:=0
  101. Local i1:=0
  102. Local p:=0
  103. for i:=1 to 32
  104.     for i1:=1 to 32
  105.         p:=StrGetCar(Mapae,(((i-1)*32)+i1))
  106.         SetPixel(x,y,p)
  107.     x:=x+1
  108.     next
  109.     x:=301;y:=y+1
  110. next
  111. return(nil)
  112.  
  113.  
  114.  
  115. Function VerIcono(x,y,nicono,evento,logico)
  116. Local x1:=0
  117. Local y1:=0
  118. Local i:=0
  119. Local i1:=0
  120. Local p:=0
  121. Local cp:=""
  122. Local cp1:=""
  123. x1:=x;y1:=y
  124. RCursoroff()
  125. Mapa:=Memoread(nicono)
  126. for i:=1 to 32
  127.     for i1:=1 to 32
  128.         p:=StrGetCar(Mapa,(((i-1)*32)+i1))
  129.         SetPixel(x,y,p)
  130.     x:=x+1
  131.     next
  132.     x:=x1;y:=y+1
  133. next
  134. if logico=.t.
  135.    for i:=1 to 20
  136.        if Empty(EventIcon[i,1])
  137.           EventIcon[i,1]:=nicono
  138.           EventIcon[i,2]:=Str(x1)
  139.           EventIcon[i,3]:=Str(y1)
  140.           EventIcon[i,4]:=Str(x1+32)
  141.           EventIcon[i,5]:=Str(y1+32)
  142.           EventIcon[i,6]:=evento
  143.           i:=20
  144.        endif
  145.    next
  146. endif
  147. RcursorOn()
  148. return(nil)
  149.  
  150.  
  151.  
  152. Function Fondo(cf)
  153. Local i:=0
  154. Local i1:=0
  155. Local p:=0
  156. for i:=1 to 32
  157.     for i1:=1 to 32
  158.         StrSetCar(Mapae,(((i1-1)*32)+i),cf)
  159.     next
  160. next
  161. seeiconot()
  162. return(nil)
  163.  
  164.  
  165.  
  166. Function ChangColor()
  167. Local xx:=rGetPosX()
  168. Local yy:=rGetPosy()
  169. Local x:=1
  170. Local y:=372
  171. Local x1:=32
  172. Local y1:=392
  173. Local i:=0
  174. for i=1 to 8
  175.     if rInZone(x,y,x1,y1)
  176.        color:=i-1
  177.     endif
  178.     x:=x+32;x1:=x1+32
  179. next
  180. x:=1;y=392;x1:=32;y1:=412
  181. for i=1 to 8
  182.     if rInZone(x,y,x1,y1)
  183.        color:=i+8-1
  184.     endif
  185.     x:=x+32;x1:=x1+32
  186. next
  187. ColorPixel(Color)
  188. return(nil)
  189.  
  190.  
  191.  
  192. Function ChangFondo()
  193. Local xx:=rGetPosX()
  194. Local yy:=rGetPosy()
  195. Local x:=1
  196. Local y:=372
  197. Local x1:=32
  198. Local y1:=392
  199. Local i:=0
  200. for i=1 to 8
  201.     if rInZone(x,y,x1,y1)
  202.        colorf:=(i-1)
  203.     endif
  204.     x:=x+32;x1:=x1+32
  205. next
  206. x:=1;y=392;x1:=32;y1:=412
  207. for i=1 to 8
  208.     if rInZone(x,y,x1,y1)
  209.        colorf:=(i+8-1)
  210.     endif
  211.     x:=x+32;x1:=x1+32
  212. next
  213. fondo(colorf)
  214. ColorFondo(Color)
  215. return(nil)
  216.  
  217.  
  218.  
  219. Function rInZone(zx,zy,zx1,zy1)
  220. Local x:=rGetPosX()
  221. Local y:=rGetPosy()
  222. Local logico:=.t.
  223. if x<zx
  224.    logico=.f.
  225. endif
  226. if x>zx1
  227.    logico=.f.
  228. endif
  229. if y<zy
  230.    logico:=.f.
  231. endif
  232. if y>zy1
  233.    logico:=.f.
  234. endif
  235. return(logico)
  236.  
  237.  
  238.  
  239. Function ColorPixel(Color)
  240. GpaintZone(280,372,320,392,Color)
  241. return(nil)
  242.  
  243.  
  244.  
  245. Function ColorFondo(Color)
  246. GpaintZone(280,393,320,412,Color)
  247. return(nil)
  248.  
  249.  
  250.  
  251. Function Pantalla()
  252. Local x:=1
  253. Local y:=102
  254. Local x1:=1
  255. Local y1:=358
  256. Local i:=0
  257. Local i1:=0
  258. color:=0
  259. SetVga()
  260. GpaintZone(0,0,639,479,8)
  261. Gbox(1,1,639,25,7)
  262. Gbox(2,2,638,24,7)
  263. Gbox(3,3,637,23,7)
  264. Gline(4,4,636,4,0)
  265. Gline(636,4,636,22,0)
  266. Gline(5,5,636,5,0)
  267. Gline(635,4,635,22,0)
  268. Gline(6,6,634,6,0)
  269. Gline(634,4,634,21,0)
  270. GpaintZone(7,7,633,22,1)
  271. Dispstr("Fast Icons Editor",232,7,14,1,8)
  272. Gbox(1,30,639,92,7)
  273. Gbox(2,31,638,91,7)
  274. Gbox(3,32,637,90,7)
  275. Gline(4,53,636,53,7)
  276. Gline(4,54,636,54,7)
  277. Gline(4,55,636,55,7)
  278. GpaintZone(8,33,635,52,1)
  279. Gline(9,33,636,33,0)
  280. Gline(635,36,635,52,0)
  281. Gline(9,34,636,34,0)
  282. Gline(634,36,634,52,0)
  283. GpaintZone(9,56,633,89,11)
  284. Dispstr("Exit",12,36,14,1,8)
  285. VerIcono(10,57,"salida.fic","exit()",.t.)
  286. Dispstr("System",55,36,14,1,8)
  287. VerIcono(63,57,"msdos.fic","MsDos()",.t.)
  288. Dispstr("Files",191,36,14,1,8)
  289. VerIcono(120,57,"new.fic","New()",.t.)
  290. VerIcono(154,57,"abrir.fic")
  291. VerIcono(188,57,"salvar.fic","Salvar()",.t.)
  292. VerIcono(222,57,"salvac.fic")
  293. VerIcono(256,57,"borrar.fic")
  294. Dispstr("Works",388,36,14,1,8)
  295. VerIcono(310,57,"cuadro.fic","Cuadro()",.t.)
  296. VerIcono(344,57,"cubos.fic","Cubos()",.t.)
  297. VerIcono(378,57,"circulov.fic")
  298. VerIcono(412,57,"circulor.fic")
  299. VerIcono(446,57,"lineas.fic","Lineas()",.t.)
  300. VerIcono(480,57,"brocha.fic")
  301. Dispstr("About",537,36,14,1,8)
  302. VerIcono(540,57,"fast.fic","About()",.t.)
  303. Dispstr("Help",599,36,14,1,8)
  304. VerIcono(601,57,"help.fic")
  305. Gbox(1,455,639,479,7)
  306. Gbox(2,456,638,478,7)
  307. Gbox(3,457,637,477,7)
  308. GpaintZone(5,458,635,475,1)
  309. gline(16,460,16,475,1)
  310. Dispstr("Name of File : uno.fic",8,460,14,1,8)
  311. Pantalla1()
  312. return(nil)
  313.  
  314.  
  315.  
  316. Function Pantalla1()
  317. Local x:=1
  318. Local y:=102
  319. Local x1:=1
  320. Local y1:=358
  321. Local i:=0
  322. Local i1:=0
  323. color:=0
  324. Gbox(1,102,256,358,7)
  325. for i=1 to 31
  326.     x:=x+8;x1:=x1+8
  327.     GLine(x,y,x1,y1,7)
  328. next
  329. x:=1;x1=256;y1=102
  330. for i=1 to 31
  331.     y:=y+8;y1:=y1+8
  332.     GLine(x,y,x1,y1,7)
  333. next
  334. x:=1;y:=372;x1:=32;y1:=392
  335. for i=1 to 8
  336.     Gbox(x,y,x1,y1,7)
  337.     for i1=1 to 19
  338.     GLine(x+1,y+i1,x1-1,y+i1,color)
  339.     next
  340.     x:=x+32;x1:=x1+32
  341.     color:=color+1
  342. next
  343. x:=1;y=392;x1:=32;y1:=412
  344. for i=1 to 8
  345.     Gbox(x,y,x1,y1,7)
  346.     for i1=1 to 19
  347.     GLine(x+1,y+i1,x1-1,y+i1,color)
  348.     next
  349.     x:=x+32;x1:=x1+32
  350.     color:=color+1
  351. next
  352. return(nil)
  353.  
  354.  
  355.  
  356. Function GPaintZone(lx,cx,ly,cy,color)
  357.     local bucle,nbuclei,nbuclef,canchoi,canchof
  358.     nbuclei=cx;nbuclef=cy
  359.     canchoi=lx;canchof=ly
  360.     for bucle=nbuclei to nbuclef
  361.         GLine(canchoi,bucle,canchof,bucle,color)
  362.     next
  363. return(nil)
  364.  
  365.  
  366.  
  367. Function Exit()
  368.          nKey:=27
  369. return(nil)
  370.  
  371.  
  372.  
  373. Function MsDos()
  374.          rCursoroff()
  375.          TxtMode()
  376.      cls
  377.      ? "Type EXIT to return"
  378.          DosShell()
  379.          pantalla()
  380.          rSetPos(1,1)
  381.      rCursorOn()
  382. return(nil)
  383.  
  384.  
  385.  
  386. Function New()
  387. Mapae:=space(1024)
  388. rCursorOff()
  389. pantalla1()
  390. Fondo(15)
  391. SeeIconot()
  392. SeeIconotg()
  393. rCursorOn()
  394. return(nil)
  395.  
  396.  
  397.  
  398. Function Salvar()
  399. GpaintZone(5,458,635,475,1)
  400. Dispstr("Saving File...",8,460,14,1,8)
  401. MemoWrit(IconName,Mapae)
  402. GpaintZone(5,458,635,475,1)
  403. Dispstr("Name of File : uno.fic",8,460,14,1,8)
  404. return(nil)
  405.  
  406.  
  407.  
  408. Function About()
  409. rCursorOff()
  410. Gbox(350,150,600,380,7)
  411. Gbox(351,151,599,379,7)
  412. Gbox(352,152,598,378,7)
  413. Gline(353,170,597,170,7)
  414. Gline(353,171,597,171,7)
  415. Gline(353,172,597,172,7)
  416. GpaintZone(354,154,596,169,1)
  417. Dispstr("About",460,154,14,1,8)
  418. GpaintZone(354,175,596,376,15)
  419. Dispstr("Fast Icons Editor",400,185,0,15,8)
  420. Dispstr("Versión : Alfa 1.0",360,215,0,15,8)
  421. Dispstr("Fast Versión : 3.00",360,230,0,15,8)
  422. Dispstr("Created by Yosu Unibaso",360,255,0,15,8)
  423. Dispstr("Fast Library for Clipper",360,285,0,15,8)
  424. Dispstr("is property of Manu Roibal",360,300,0,15,8)
  425. Gbox(450,335,500,360,0)
  426. Gbox(451,336,499,359,0)
  427. Gbox(452,337,498,358,0)
  428. GpaintZone(453,338,497,357,7)
  429. Dispstr("OK",468,340,15,7,8)
  430. rCursorOn()
  431. Do while !rInZone(450,335,500,360)
  432.    rInkey(0)
  433. Enddo
  434. rCursorOff()
  435. GpaintZone(350,150,600,400,8)
  436. rCursorOn()
  437. return(nil)
  438.  
  439.  
  440.  
  441. Function cuadro()
  442. Local swc:=0
  443. Local x1:=0
  444. Local y1:=0
  445. Local x2:=0
  446. Local y2:=0
  447. Local swi:=""
  448. Local n1:=0
  449. Local n2:=0
  450. Local i:=0
  451. Local i1:=0
  452. Local x1l:=0
  453. Local y1c:=0
  454. Local x2l:=0
  455. Local y2c:=0
  456. Local xil:=0
  457. Local yic:=0
  458. Local xfl:=0
  459. Local yfc:=0
  460. Local cxy:=array(4,4)
  461. Local p:=0
  462. rCursorOff()
  463. Gbox(350,150,600,380,7)
  464. Gbox(351,151,599,379,7)
  465. Gbox(352,152,598,378,7)
  466. Gline(353,170,597,170,7)
  467. Gline(353,171,597,171,7)
  468. Gline(353,172,597,172,7)
  469. GpaintZone(354,154,596,169,1)
  470. Dispstr("Boxes",435,154,14,1,8)
  471. GpaintZone(354,175,596,376,15)
  472. Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  473. Dispstr("the upper left corner of ",360,202,0,15,8)
  474. Dispstr("the box.                 ",360,219,0,15,8)
  475. Gbox(450,335,500,360,0)
  476. Gbox(451,336,499,359,0)
  477. Gbox(452,337,498,358,0)
  478. GpaintZone(453,338,497,357,7)
  479. Dispstr("OUT",463,340,15,7,8)
  480. rCursorOn()
  481. Do While swc=0
  482.    Do while .t.
  483.       rInkey(0)
  484.       if rInZone(450,335,500,360)
  485.          swc=1
  486.          exit
  487.       endif
  488.       if rInZone(1,102,256,358)
  489.          x1:=rGetPosX();y1:=rGetPosY()
  490.          x1l:=int((x1-1)/8)+1
  491.          y1c:=int((y1-102)/8)+1
  492.          exit
  493.       endif
  494.    Enddo
  495.    if swc=1
  496.       exit
  497.    endif
  498.    rCursorOff()
  499.    GpaintZone(354,175,596,376,15)
  500.    Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  501.    Dispstr("the botton right corner  ",360,202,0,15,8)
  502.    Dispstr("of the box.               ",360,219,0,15,8)
  503.    Gbox(450,335,500,360,0)
  504.    Gbox(451,336,499,359,0)
  505.    Gbox(452,337,498,358,0)
  506.    GpaintZone(453,338,497,357,7)
  507.    Dispstr("OUT",463,340,15,7,8)
  508.    rCursorOn()
  509.    Do while .t.
  510.       rInkey(0)
  511.       if rInZone(450,335,500,360)
  512.          swc=1
  513.          exit
  514.       endif
  515.       if rInZone(1,102,256,358)
  516.          x2:=rGetPosX();y2:=rGetPosY()
  517.          x2l:=int((x2-1)/8)+1
  518.          y2c:=int((y2-102)/8)+1
  519.          swc=1;exit
  520.       endif
  521.    Enddo
  522. Enddo
  523. rCursorOff()
  524. if y1c<y2c
  525.    xil:=x1l;yic:=y1c
  526.    xfl:=x2l;yfc:=y2c
  527. else
  528.    xil:=x2l;yic:=y2c
  529.    xfl:=x1l;yfc:=y1c
  530. endif
  531. cxy[1,1]:=xil;cxy[1,2]:=yic;cxy[1,3]:=xfl;cxy[1,4]:=yic
  532. cxy[2,1]:=xfl;cxy[2,2]:=yic;cxy[2,3]:=xfl;cxy[2,4]:=yfc
  533. cxy[3,1]:=xil;cxy[3,2]:=yic;cxy[3,3]:=xil;cxy[3,4]:=yfc
  534. cxy[4,1]:=xil;cxy[4,2]:=yfc;cxy[4,3]:=xfl;cxy[4,4]:=yfc
  535. for i1:=1 to 4
  536.     x1l:=cxy[i1,1];y1c:=cxy[i1,2]
  537.     x2l:=cxy[i1,3];y2c:=cxy[i1,4]
  538.     if x1l=x2l
  539.        swi:="x"
  540.     endif
  541.     if y1c=y2c
  542.        swi:="y"
  543.     endif
  544.     if swi="y"
  545.        if x1l<x2l
  546.           n1:=x1l;n2:=x2l
  547.        else
  548.           n1:=x2l;n2:=x1l
  549.        endif
  550.        for i:=n1 to n2
  551.            StrSetCar(Mapae,(((y1c-1)*32)+i),color)
  552.            GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
  553.        next
  554.     endif
  555.     if swi="x"
  556.        if y1c<y2c
  557.           n1:=y1c;n2:=y2c
  558.        else
  559.           n1:=y2c;n2:=y1c
  560.        endif
  561.        for i:=n1 to n2
  562.            StrSetCar(Mapae,(((i-1)*32)+x1l),color)
  563.            GPaintZone(((x1l-1)*8)+1,((i-1)*8)+103,(x1l*8)-1,(i*8)+101,color)
  564.        next
  565.     endif
  566. next
  567. SeeIconoT()
  568. GpaintZone(350,150,600,400,8)
  569. rCursorOn()
  570. return(nil)
  571.  
  572.  
  573.  
  574.  
  575. Function cubos()
  576. Local swc:=0
  577. Local x1:=0
  578. Local y1:=0
  579. Local x2:=0
  580. Local y2:=0
  581. Local swi:=""
  582. Local n1:=0
  583. Local n2:=0
  584. Local i:=0
  585. Local i1:=0
  586. Local x1l:=0
  587. Local y1c:=0
  588. Local x2l:=0
  589. Local y2c:=0
  590. Local xil:=0
  591. Local yic:=0
  592. Local xfl:=0
  593. Local yfc:=0
  594. Local cxy:=array(4,4)
  595. Local p:=0
  596. rCursorOff()
  597. Gbox(350,150,600,380,7)
  598. Gbox(351,151,599,379,7)
  599. Gbox(352,152,598,378,7)
  600. Gline(353,170,597,170,7)
  601. Gline(353,171,597,171,7)
  602. Gline(353,172,597,172,7)
  603. GpaintZone(354,154,596,169,1)
  604. Dispstr("Filled boxes",410,154,14,1,8)
  605. GpaintZone(354,175,596,376,15)
  606. Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  607. Dispstr("the upper left corner of ",360,202,0,15,8)
  608. Dispstr("the filled box.          ",360,219,0,15,8)
  609. Gbox(450,335,500,360,0)
  610. Gbox(451,336,499,359,0)
  611. Gbox(452,337,498,358,0)
  612. GpaintZone(453,338,497,357,7)
  613. Dispstr("OUT",463,340,15,7,8)
  614. rCursorOn()
  615. Do While swc=0
  616.    Do while .t.
  617.       rInkey(0)
  618.       if rInZone(450,335,500,360)
  619.          swc=1
  620.          exit
  621.       endif
  622.       if rInZone(1,102,256,358)
  623.          x1:=rGetPosX();y1:=rGetPosY()
  624.          x1l:=int((x1-1)/8)+1
  625.          y1c:=int((y1-102)/8)+1
  626.          exit
  627.       endif
  628.    Enddo
  629.    if swc=1
  630.       exit
  631.    endif
  632.    rCursorOff()
  633.    GpaintZone(354,175,596,376,15)
  634.    Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  635.    Dispstr("the botton right corner  ",360,202,0,15,8)
  636.    Dispstr("of the filled box.        ",360,219,0,15,8)
  637.    Gbox(450,335,500,360,0)
  638.    Gbox(451,336,499,359,0)
  639.    Gbox(452,337,498,358,0)
  640.    GpaintZone(453,338,497,357,7)
  641.    Dispstr("OUT",463,340,15,7,8)
  642.    rCursorOn()
  643.    Do while .t.
  644.       rInkey(0)
  645.       if rInZone(450,335,500,360)
  646.          swc=1
  647.          exit
  648.       endif
  649.       if rInZone(1,102,256,358)
  650.          x2:=rGetPosX();y2:=rGetPosY()
  651.          x2l:=int((x2-1)/8)+1
  652.          y2c:=int((y2-102)/8)+1
  653.          swc=1;exit
  654.       endif
  655.    Enddo
  656. Enddo
  657. rCursorOff()
  658. if y1c<y2c
  659.    xil:=x1l;yic:=y1c
  660.    xfl:=x2l;yfc:=y2c
  661. else
  662.    xil:=x2l;yic:=y2c
  663.    xfl:=x1l;yfc:=y1c
  664. endif
  665. for i1:=yic to yfc
  666.        x1l:=xil;y1c:=i1
  667.        x2l:=xfl;y2c:=i1
  668.        for i:=x1l to x2l
  669.            StrSetCar(Mapae,(((y1c-1)*32)+i),color)
  670.            GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
  671.        next
  672. next
  673. SeeIconoT()
  674. GpaintZone(350,150,600,400,8)
  675. rCursorOn()
  676. return(nil)
  677.  
  678.  
  679.  
  680. Function lineas()
  681. Local swc:=0
  682. Local x1:=0
  683. Local y1:=0
  684. Local x2:=0
  685. Local y2:=0
  686. Local swi:=""
  687. Local n1:=0
  688. Local n2:=0
  689. Local i:=0
  690. Local x1l:=0
  691. Local y1c:=0
  692. Local x2l:=0
  693. Local y2c:=0
  694. Local p:=0
  695. rCursorOff()
  696. Gbox(350,150,600,380,7)
  697. Gbox(351,151,599,379,7)
  698. Gbox(352,152,598,378,7)
  699. Gline(353,170,597,170,7)
  700. Gline(353,171,597,171,7)
  701. Gline(353,172,597,172,7)
  702. GpaintZone(354,154,596,169,1)
  703. Dispstr("Lines",452,154,14,1,8)
  704. GpaintZone(354,175,596,376,15)
  705. Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  706. Dispstr("the first point of the   ",360,202,0,15,8)
  707. Dispstr("line.                    ",360,219,0,15,8)
  708. Gbox(450,335,500,360,0)
  709. Gbox(451,336,499,359,0)
  710. Gbox(452,337,498,358,0)
  711. GpaintZone(453,338,497,357,7)
  712. Dispstr("OUT",463,340,15,7,8)
  713. rCursorOn()
  714. Do While swc=0
  715.    Do while .t.
  716.       rInkey(0)
  717.       if rInZone(450,335,500,360)
  718.          swc=1
  719.          exit
  720.       endif
  721.       if rInZone(1,102,256,358)
  722.          x1:=rGetPosX();y1:=rGetPosY()
  723.          x1l:=int((x1-1)/8)+1
  724.          y1c:=int((y1-102)/8)+1
  725.          exit
  726.       endif
  727.    Enddo
  728.    if swc=1
  729.       exit
  730.    endif
  731.    rCursorOff()
  732.    GpaintZone(354,175,596,376,15)
  733.    Dispstr("Punch with the mouse on  ",360,185,0,15,8)
  734.    Dispstr("the second point of the  ",360,202,0,15,8)
  735.    Dispstr("line.                    ",360,219,0,15,8)
  736.    Gbox(450,335,500,360,0)
  737.    Gbox(451,336,499,359,0)
  738.    Gbox(452,337,498,358,0)
  739.    GpaintZone(453,338,497,357,7)
  740.    Dispstr("OUT",463,340,15,7,8)
  741.    rCursorOn()
  742.    Do while .t.
  743.       rInkey(0)
  744.       if rInZone(450,335,500,360)
  745.          swc=1
  746.          exit
  747.       endif
  748.       if rInZone(1,102,256,358)
  749.          x2:=rGetPosX();y2:=rGetPosY()
  750.          x2l:=int((x2-1)/8)+1
  751.          y2c:=int((y2-102)/8)+1
  752.          if x1l=x2l
  753.             swi:="x";swc=1;exit
  754.          endif
  755.          if y1c=y2c
  756.             swi:="y";swc=1;exit
  757.          endif
  758.       endif
  759.    Enddo
  760. Enddo
  761. rCursorOff()
  762. if swi="y"
  763.    if x1l<x2l
  764.       n1:=x1l;n2:=x2l
  765.    else
  766.       n1:=x2l;n2:=x1l
  767.    endif
  768.    for i:=n1 to n2
  769.         StrSetCar(Mapae,(((y1c-1)*32)+i),color)
  770.         GPaintZone(((i-1)*8)+1,((y1c-1)*8)+103,(i*8)-1,(y1c*8)+101,color)
  771.    next
  772. endif
  773. if swi="x"
  774.    if y1c<y2c
  775.       n1:=y1c;n2:=y2c
  776.    else
  777.       n1:=y2c;n2:=y1c
  778.    endif
  779.    for i:=n1 to n2
  780.         StrSetCar(Mapae,(((i-1)*32)+x1l),color)
  781.         GPaintZone(((x1l-1)*8)+1,((i-1)*8)+103,(x1l*8)-1,(i*8)+101,color)
  782.    next
  783. endif
  784. SeeIconoT()
  785. GpaintZone(350,150,600,400,8)
  786. rCursorOn()
  787. return(nil)
  788.  
  789.  
  790.  
  791.  
  792.