home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 44 / demos / gemsys.bas < prev    next >
Encoding:
BASIC Source File  |  1986-08-15  |  2.8 KB  |  61 lines

  1. 100   '************ GEMSYS() DEMO PROGRAM ************
  2. 110   '************ by JIM LUCZAK **********
  3. 120   '
  4. 130   ' ----------- INITIALIZE PROGRAM -------------
  5. 140   fullw 2: clearw 2: flag=0: bs=0: offset=22
  6. 150   a#=gb
  7. 160   gintin=peek(a#+8): ' Defint Integer Input
  8. 170   gintout=peek(a#+12): ' Define Integer Output
  9. 180   a$="Hold LEFT mouse button down when entering or exiting box to EXIT demo"
  10. 190   '-------- DRAW GROWING BOX --------
  11. 200   poke gintin,320: ' X coordinate initial size
  12. 210   poke gintin+2,75+offset: ' Y coordinate initial size
  13. 220   poke gintin+4,2: ' Initial width
  14. 230   poke gintin+6,1: ' Initial height
  15. 240   poke gintin+8,270: ' X coordinate final size
  16. 250   poke gintin+10,25+offset: ' Y coordinate final size
  17. 260   poke gintin+12,100: ' Final width
  18. 270   poke gintin+14,100: ' Final height
  19. 280   gemsys(73): ' Graf growbox
  20. 290   ' -------- DRAW BOX OUTLINE ------
  21. 300   linef 270,25,370,25
  22. 310   linef 370,25,370,125
  23. 320   linef 370,125,270,125
  24. 330   linef 270,125,270,25
  25. 340   gotoxy 3,14: ?a$
  26. 350   '--------FIND POINTER LOCATION -------
  27. 360   gemsys(79): ' 
  28. 370   mx=peek(gintout+2): ' Current X coordinate of pointer
  29. 380   my=peek(gintout+4): ' Current Y coordinate of pointer
  30. 390   flag=0
  31. 400   if (mx>270 and mx<370) and (my>25+offset and my<125+offset) then flag=1
  32. 410   '------------ SET UT PARAMETERS FOR MOUSE EVENT -------
  33. 420   poke gintin+2,270:' X coordinate of rectangle
  34. 430   poke gintin+4,25+offset: ' Y coordinate of rectangle
  35. 440   poke gintin+6,100: 'Width of rectangle
  36. 450   poke gintin+8,100: ' Height of rectangle
  37. 460   '------------ MAKE SURE MOUSE POINTER IS VISIBLE --------
  38. 470   poke gintin,257: ' Show mouse form
  39. 480   gemsys(78): ' Graf muse
  40. 490   '--------- MAIN PROGRAM LOOP -----------
  41. 500   while bs=0
  42. 510   poke gintin,index: ' Mouse form
  43. 520   gemsys(78): ' Graf mouse
  44. 530   poke gintin,flag: ' Flag for event mouse call
  45. 540   gemsys(22): ' Event mouse
  46. 550   mx=peek(gintout+2): 'X coordinate of mouse
  47. 560   my=peek(gintout+4): ' Y coordinate of mouse
  48. 570   bs=peek(gintout+6): ' State of mouse button
  49. 580   if flag=0 then flag=1: B$="Mouse ENTERED" else flag=0: b$="Mouse EXITED"
  50. 590   gotoxy 9,1: ?b$" box at these Coordinates.  X = "mx"  Y = "my"   "
  51. 600   index=index+1: if index>7 then index=0
  52. 610   wend
  53. 620   '------- DRAW SHRINKING BOX --------
  54. 630   poke gintin,320: ' X coordinate final size
  55. 640   poke gintin+2,75+offset: ' Y coordinate final size
  56. 650   poke gintin+4,2: ' Final width
  57. 660   poke gintin+6,1: ' Final height
  58. 670   poke gintin+8,270: ' X coordinate initial size
  59. 680   poke gintin+10,25+offset: ' Y coordinate initial size
  60. 690   poke gintin+12,100: ' Initial width
  61. əəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəə