home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 December / SOFM_Dec1995.bin / pc / win / dtp / formgx / demo.sx_ / demo.sx
Text File  |  1995-10-31  |  3KB  |  108 lines

  1. ////////////////////////////////
  2. // Sample script
  3.  
  4. sound_test:
  5.     if SOUND_DEVICE
  6.         set condition 30
  7.  
  8. /////////////////////////////
  9. install_icon:
  10.     $target = "formula"
  11.     $title = "Formula Graphics"
  12.     $destdir = get directory
  13.     DDE "PROGMAN" string "[DeleteGroup(",$title,")]"
  14.     DDE "PROGMAN" string "[CreateGroup(",$title,")]"
  15.     DDE "PROGMAN" string "[ShowGroup(1)]"
  16.     DDE "PROGMAN" string "[AddItem(",$destdir,"\",$target,".exe,",$title,",",$destdir,"\",$target,".exe,0)]"
  17.  
  18. /////////////////////////////
  19. init_balls:
  20.     ball_list = new list
  21.     ball = new script "ball.sxt"
  22.     ball_list add ball
  23.     $name = "ball_red.gif"
  24.     ball call init: @name,0,130,5,2
  25.  
  26.     ball = new script "ball.sxt"
  27.     ball_list add ball
  28.     $name = "ball_grn.gif"
  29.     ball call init: @name,0,280,2,-5
  30.  
  31.     ball = new script "ball.sxt"
  32.     ball_list add ball
  33.     $name = "ball_blu.gif"
  34.     ball call init: @name,0,180,-4,3
  35.     free ball
  36.  
  37.     timer_count = TIME
  38.  
  39. /////////////////////////////////////////
  40. play_balls: mess, wparam, loword, hiword
  41.  
  42.     if timer_count < TIME - 1
  43.         for n = 0 to 2
  44.             ball = ball_list get n
  45.             ball call show
  46.         free ball
  47.         update sprites
  48.         timer_count = TIME
  49.  
  50. ////////////////////////////////
  51. clear_balls:
  52.     free ball_list
  53.     update sprites
  54.  
  55. ///////////////////////////
  56. next_hyperpage:
  57.     page = strval getrange "700/710"
  58.     page = page + 1
  59.     if page > 703 then page = 700
  60.     set condition "-700/710,",page
  61.  
  62. ///////////////////////////
  63. show_edit_boxes:
  64.     set editbox "edit box 1" = "Formula"
  65.     $abc = "Using the Formula Graphics high level object oriented language, you can write text to the contents of an edit box. You can also read the information typed into an edit box. The information can then be analysed in any way imaginable."
  66.     set editbox "edit box 2" = $abc
  67.  
  68.     element_list = new byte[20][30]
  69.     $element_list[0] = "Picture";"Animation";"Sound";"Video";"Text";"Picture Button";"Text Button";"Hot Area";"Hot Color";"Hypertext";"Edit box";"List Box";"Graph"
  70.     for n = 0 to 12
  71.         index = listbox "list box 1" add $element_list[n]
  72.  
  73. /////////////////////////
  74. setup_graph:
  75.     colors = new byte[3][3]
  76.     colors[0][0] = 200,130,100
  77.     colors[1][0] = 100,180,130
  78.     colors[2][0] = 100,160,210
  79.  
  80. ///////////////////////////
  81. graph_data:
  82.     data = new float[3][4]
  83.     for n,m = 0,0 to 2,3
  84.         data[n][m] = 10 + rnd 90
  85.     return @data, @colors, 0, 100, 10
  86.  
  87. ///////////////////////////
  88. pie_graph_data:
  89.     data = new float[3]
  90.     max = 0
  91.     for n = 0 to 2
  92.         data[n] = 20 + rnd 80
  93.         max = max + data[n]
  94.     for n = 0 to 2
  95.         data[n] = floor (data[n] / max * 1000) / 10
  96.  
  97.     return @data, @colors, 0, 100, 0
  98.  
  99. ///////////////////////////
  100. play_game:
  101.     display "sam6foot.gif"
  102.     killer = new script "killmain.sxt"
  103.     killer call start
  104.     free killer
  105.     update sprites
  106.  
  107. ///////////////////////////////////
  108. /////////////////////////////////