home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / envsof20 / source / create_images.pprx < prev    next >
Encoding:
Text File  |  1999-08-31  |  1.9 KB  |  78 lines

  1. /*
  2.  * create_images.pprx - Create toolbar images by extracting brushes from the
  3.  *                      from toolbar.ilbm using PPaint 7.x
  4.  *
  5.  * $VER: create_images.pprx 1.1 (28.8.99)
  6.  *
  7.  * Copyright 1999 Thomas Aglassinger and others, see file "forum.txt"
  8.  */
  9.  
  10. directory = 'prog:envSOFxx/source/images'
  11.  
  12. images = ''
  13.  
  14. /* Names of images to extract */
  15. images = images || 'view_as_class         view_as_short                   * '
  16. images = images || 'view_as_class_ghosted view_as_short_ghosted           * '
  17. images = images || 'open_class            open_short                      * '
  18. images = images || 'new_class             reformat               features * '
  19. images = images || 'make                  help                            * '
  20.  
  21. old_directory = Pragma('D', directory)
  22.  
  23. /* Come up with PPaint*/
  24. PPPORT = 'PPAINT'
  25. IF ~SHOW('P', PPPORT) THEN DO
  26.    IF EXISTS('PPaint:PPaint') THEN DO
  27.       ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  28.       DO 30 WHILE ~SHOW('P',PPPORT)
  29.           ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  30.       END
  31.    END
  32.    ELSE DO
  33.       SAY "Personal Paint could not be loaded."
  34.       EXIT 10
  35.    END
  36. END
  37.  
  38. IF ~SHOW('P', PPPORT) THEN DO
  39.    SAY 'Personal Paint Rexx port could not be opened'
  40.    EXIT 10
  41. END
  42.  
  43. ADDRESS VALUE PPPORT
  44. OPTIONS RESULTS
  45.  
  46. if 1 then do
  47.    'LoadImage toolbar.ilbm Force'
  48. end
  49.  
  50. line = 0
  51. column = 0
  52. quit = 0
  53.  
  54. do while ~quit
  55.    image_name = Word(images, 1)
  56.    if image_name = '' then do
  57.       quit = 1
  58.    end
  59.    else if image_name = '*' then do
  60.       line = line + 1
  61.       column = 0
  62.    end
  63.    else do
  64.       Say line column image_name
  65.       x0 = 24 * column + 25
  66.       y0 = 20 * line
  67.       x1 = x0 + 23
  68.       y1 = y0 + 19
  69.       'DefineBrush x0=' || x0 || ' y0=' || y0 || ' x1=' || x1 || ' y1=' || y1
  70.       'SaveBrush File="goldEd:etc/images/toolbar/eiffel/' || image_name || '"'
  71.       column = column + 1
  72.    end
  73.    images = DelWord(Strip(images, 'L'), 1,1)
  74. end
  75.  
  76. Pragma('D', old_directory)
  77.  
  78.