home *** CD-ROM | disk | FTP | other *** search
- /* Allow commands to return results */
-
- options results
-
- /* On error, goto ERROR:. Comment out this line if you wish to */
- /* perform your own error checking. */
-
- signal on error
-
- 'PROJECT_LOCK'
-
- /* BEGIN PROGRAM *************************************************/
-
- /*
- PROGRAM: ShadowSoft.dsdr
- DESCRIPTION: Draws a soft shadow for the selected object(s).
- The shadow is offset by some amount, which may
- be re-positioned later. Change the "Offset"
- value below to change the default shadow offset.
- Change the "Size" value to determine amount
- of "blur" in the shadow.
- DATE: 03/11/96
- AUTHOR: Andy Dean
- */
-
- Offset = '0.25in'
- Size = 0.05
- Opacity = 6
-
- /* Offset shadows */
-
- offsetx.1 = 0.000
- offsety.1 = 1.000
- offsetx.2 = 0.707
- offsety.2 = 0.707
- offsetx.3 = 1.000
- offsety.3 = 0.000
- offsetx.4 = 0.707
- offsety.4 = -0.707
-
- offsetx.5 = 0.000
- offsety.5 = -1.000
- offsetx.6 = -0.707
- offsety.6 = -0.707
- offsetx.7 = -1.000
- offsety.7 = -1.000
- offsetx.8 = -0.707
- offsety.8 = 0.707
-
- REDRAW_OFF
-
- /* Get info on the selected object(s) */
-
- OBJECT_SPECS_GET stem 'srcobj.'
-
- /* If there's more than 1 object, group them */
- /* and store their name */
-
- if srcobj.numselected > 1 then do
- OBJECT_GROUP stem 'srcgrp.'
-
- srcname = srcgrp.name
- end
- else do
- srcname = srcobj.name
- end
-
- /* Clone the original object 8 times, offsetting */
- /* Each copy in a circle to provide a blurred effect */
-
- do l = 1 to 8
- /* How big is the blur ? */
-
- offx = Size * offsetx.l
- offy = Size * offsety.l
-
- /* Clone the object, offsetting slightly */
-
- OBJECT_CLONE '"'offx'in"' '"'offy'in"'
-
- /* Get the name of the new object and store it */
-
- OBJECT_SPECS_GET stem 'clone.'
- cloneobj.l = clone.name
-
- /* Fill the object to transparent black */
-
- ATTRS_FILLCOLOUR_SET 0 0 0 Opacity
- ATTRS_PENFILL_SET None None
-
- /* Deselect the cloned object and select the */
- /* original again */
-
- OBJECT_DESELECT '"'cloneobj.l'"'
- OBJECT_SELECT '"'srcname'"'
-
- end
-
- /* Deselect all */
-
- OBJECT_DESELECT
-
- /* Group all shadow objects */
-
- do l = 1 to 8
- OBJECT_SELECT '"'cloneobj.l'"'
- end
-
- OBJECT_GROUP
-
- /* Offset shadow and deselect */
-
- OBJECT_MOVE Offset Offset
-
- OBJECT_DESELECT
-
- /* Select original object and bring to front */
-
- OBJECT_SELECT '"'srcname'"'
-
- OBJECT_TOFRONT
-
- /* If it was grouped, ungroup */
-
- if srcobj.numselected > 1 then
- OBJECT_UNGROUP
-
- REDRAW_ON
-
- /* END PROGRAM ***************************************************/
-
- 'PROJECT_UNLOCK'
-
- exit
-
- /* On ERROR */
-
- ERROR:
-
- 'PROJECT_UNLOCK'
-
- /* If we get here, either an error occurred with the command's */
- /* execution or there was an error with the command itself. */
- /* In the former case, rc2 contains the error message and in */
- /* the latter, rc2 contains an error number. SIGL contains */
- /* the line number of the command which caused the jump */
- /* to ERROR: */
-
- if datatype(rc2,'NUMERIC') == 1 then do
- /* See if we can describe the error with a string */
-
- select
- when rc2 == 103 then
- err_string = "ERROR 103, "||,
- "out of memory at line "||SIGL
- when rc2 == 114 then
- err_string = "ERROR 114, "||,
- "bad command template at line "||SIGL
- when rc2 == 115 then
- err_string = "ERROR 115, "||,
- "bad number for /N argument at line "||SIGL
- when rc2 == 116 then
- err_string = "ERROR 116, "||,
- "required argument missing at line "||SIGL
- when rc2 == 117 then
- err_string = "ERROR 117, "||,
- "value after keywork missing at line "||SIGL
- when rc2 == 118 then
- err_string = "ERROR 118, "||,
- "wrong number of arguments at line "||SIGL
- when rc2 == 119 then
- err_string = "ERROR 119, "||,
- "unmatched quotes at line "||SIGL
- when rc2 == 120 then
- err_string = "ERROR 120, "||,
- "line too long at line "||SIGL
- when rc2 == 236 then
- err_string = "ERROR 236, "||,
- "unknown command at line "||SIGL
- otherwise
- err_string = "ERROR "||rc2||", at line "||SIGL
- end
- end
- else if rc2 == 'RC2' then do
- err_string = "ERROR in command at line "||SIGL
- end
- else do
- err_string = rc2||", line "||SIGL
- end
-
- req_message TEXT '"'err_string'"'
-
- exit
-