home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / d / draw_studio / drawstudiov1.0.2a.dms / drawstudiov1.0.2a.adf / DSdir1.lha / Rexx / ShadowHard.dsrx < prev    next >
Text File  |  1996-11-03  |  3KB  |  132 lines

  1. /* Allow commands to return results */
  2.  
  3. options results
  4.  
  5. /* On error, goto ERROR:. Comment out this line if you wish to */
  6. /* perform your own error checking. */
  7.  
  8. signal on error
  9.  
  10. 'PROJECT_LOCK'
  11.  
  12. /* BEGIN PROGRAM *************************************************/
  13.  
  14. /*
  15. PROGRAM:        ShadowHard.dsdr
  16. DESCRIPTION:    Draws a hard shadow for the selected object(s).
  17.         The shadow is offset by some amount, which may
  18.         be re-positioned later. Change the "Offset"
  19.         value below to change the default shadow offset.
  20. DATE:           02/11/96
  21. AUTHOR:         Andy Dean
  22. */
  23.  
  24. Offset = '0.25in'
  25. Opacity = 50
  26.  
  27. REDRAW_OFF
  28.  
  29. /* Get info on the selected object(s) */
  30.  
  31. OBJECT_SPECS_GET stem 'srcobj.'
  32.  
  33. /* If there's more than 1 object, group them */
  34. /* and store their name */
  35.  
  36. if srcobj.numselected > 1 then do
  37.     OBJECT_GROUP stem 'srcgrp.'
  38.  
  39.     srcname = srcgrp.name
  40.     end
  41. else do
  42.     srcname = srcobj.name
  43.     end
  44.  
  45. /* Clone the object, offsetting 0.25in */
  46.  
  47. OBJECT_CLONE Offset Offset
  48.  
  49. /* Fill the object to transparent black */
  50.  
  51. ATTRS_FILLCOLOUR_SET 0 0 0 Opacity
  52. ATTRS_PENFILL_SET None None
  53.  
  54. /* Bring original object to front */
  55.  
  56. OBJECT_DESELECT
  57. OBJECT_SELECT '"'srcname'"'
  58.  
  59. OBJECT_TOFRONT
  60.  
  61. /* If it was grouped, ungroup */
  62.  
  63. if srcobj.numselected > 1 then
  64.     OBJECT_UNGROUP
  65.  
  66. REDRAW_ON
  67.  
  68. /* END PROGRAM ***************************************************/
  69.  
  70. 'PROJECT_UNLOCK'
  71.  
  72. exit
  73.  
  74. /* On ERROR */
  75.  
  76. ERROR:
  77.  
  78. 'PROJECT_UNLOCK'
  79.  
  80. /* If we get here, either an error occurred with the command's */
  81. /* execution or there was an error with the command itself. */
  82. /* In the former case, rc2 contains the error message and in */
  83. /* the latter, rc2 contains an error number. SIGL contains */
  84. /* the line number of the command which caused the jump */
  85. /* to ERROR: */
  86.  
  87. if datatype(rc2,'NUMERIC') == 1 then do
  88.     /* See if we can describe the error with a string */
  89.  
  90.     select
  91.         when rc2 == 103 then
  92.             err_string = "ERROR 103, "||,
  93.                 "out of memory at line "||SIGL
  94.         when rc2 == 114 then
  95.             err_string = "ERROR 114, "||,
  96.                 "bad command template at line "||SIGL
  97.         when rc2 == 115 then
  98.             err_string = "ERROR 115, "||,
  99.                 "bad number for /N argument at line "||SIGL
  100.         when rc2 == 116 then
  101.             err_string = "ERROR 116, "||,
  102.                 "required argument missing at line "||SIGL
  103.         when rc2 == 117 then
  104.             err_string = "ERROR 117, "||,
  105.                 "value after keywork missing at line "||SIGL
  106.         when rc2 == 118 then
  107.             err_string = "ERROR 118, "||,
  108.                 "wrong number of arguments at line "||SIGL
  109.         when rc2 == 119 then
  110.             err_string = "ERROR 119, "||,
  111.                 "unmatched quotes at line "||SIGL
  112.         when rc2 == 120 then
  113.             err_string = "ERROR 120, "||,
  114.                 "line too long at line "||SIGL
  115.         when rc2 == 236 then
  116.             err_string = "ERROR 236, "||,
  117.                 "unknown command at line "||SIGL
  118.         otherwise
  119.             err_string = "ERROR "||rc2||", at line "||SIGL
  120.         end
  121.     end
  122. else if rc2 == 'RC2' then do
  123.     err_string = "ERROR in command at line "||SIGL
  124.     end
  125. else do
  126.     err_string = rc2||", line "||SIGL
  127.     end
  128.  
  129. req_message TEXT '"'err_string'"'
  130.  
  131. exit
  132.