home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser 2002 January / STC_CD_01_2002.iso / APP / TASKBAR / JAYGRPII / SIC / JGRPDEMO.SIC < prev    next >
Encoding:
Text File  |  2000-08-14  |  1.7 KB  |  72 lines

  1. // jgrpdemo.sic (c) 13.08.2000 by JAY Software
  2. //
  3. // This script demonstrates the GEMScript interface abilities
  4. // Just start it and see what happen.
  5. //
  6. // Changes:    14.08.2000  STan  The demo group is created in the
  7. //                            script dir now
  8. //
  9. // Note:    Try to execute this script more more than once
  10. //          simultaneously
  11. //              It happens that GSCG (see .HYP) references
  12. //              are updated, but the GSCGPos is set to NULL
  13. //              This follows that the group is changing colors
  14. //              and position by all script instances, but the
  15. //              Text is changed ONLY in the lastly executed
  16. //              one (the others have the GSCGPos == NULL and
  17. //              thus the Item( ai ) returs an error code)
  18. //
  19.  
  20. proc main(...)
  21. {
  22.     StrTbl[0] = " What";
  23.     StrTbl[1] = "about";
  24.     StrTbl[2] = " to";
  25.     StrTbl[3] = "move;-)";
  26.  
  27.     // Get a script path
  28.     cwd(Path);
  29.     GRPPath = Path + "jgrpdemo.grp";
  30.     
  31.     if ( address( "JAYGrpII" ) ) {
  32.         // Create a new group and set the defaults
  33.         New( GRPPath, "Demo" );
  34.         GroupDisplay( 1, 10, 0 );
  35.         GroupRect( 500, 5000, 1000, 1000 );
  36.         Add( ".", " " );
  37.         Add( ".", " " );
  38.  
  39.         ai = Item();
  40.         gr = GroupRect();
  41.         gi = GroupDisplay();
  42.  
  43.         h = 1;
  44.         v = 1;
  45.  
  46.         Open();
  47.         forever {
  48.             for( i=0; i<=15; i++ ) {
  49.                 // Text string change
  50.                 Item( ai[0], StrTbl[ i % 4 ] );
  51.  
  52.                 // Background color change
  53.                 GroupDisplay( gi[0], gi[1], gi[2], i );
  54.  
  55.                 // Window posistion change
  56.                 gr[0] += h*500;
  57.                 gr[1] += v*500;
  58.                 GroupRect( gr[0], gr[1] );
  59.  
  60.                 wait( 70 );
  61.  
  62.                 // check movement borders
  63.                 if ( gr[0] < 500 ) h = 1;
  64.                 if ( gr[0] > 8500 ) h = -1;
  65.                 if ( gr[1] < 500 ) v = 1;
  66.                 if ( gr[1] > 8500 ) v = -1;
  67.             }
  68.         }
  69.     }
  70. }
  71.  
  72.