/* ---------------------------------------------------	*/
/* Final Copy II Arexx Macro - SHADOW BOX			*/
/* This macro will draw a black shadow box for the	*/
/* current selected object, (except lines and arrows).	*/
/* ---------------------------------------------------	*/
Options Results

/* ------------------------------------	*/
/* Set parameters to be in ruler units.	*/
/* ------------------------------------	*/
SetMeasure Ruler

/* -----------------------------------------	*/
/* These are the offsets for the shadow box	*/
/* in inches. (.125 = 1/8 inch).			*/
/* -----------------------------------------	*/ 
XOffset	= .125
YOffset	= .125

/* ------------------------------------	*/
/* Get the Id of the current object.	*/
/* If there is no current object then	*/
/* exit the macro.					*/
/* ------------------------------------	*/
CurrentObject
boxid = Result
IF	(boxId = 0) THEN
	EXIT

/* ------------------------------------	*/
/* Find out the type of the object.	*/
/* We don't want to draw a shadow for	*/
/* lines or arrows.					*/
/* ------------------------------------	*/
GetObjectType boxId
type = Result
IF	(type ~= 2 & type ~= 3) THEN
	DO

	/* ------------------------------------	*/
	/* Get the coordinates and parameters	*/
	/* for the selected object.			*/
	/* ------------------------------------	*/
	GetObjectCoords boxid
	coords = Result
	GetObjectParams boxid
	params = Result

	page			= Word(coords, 1)
	left			= Word(coords, 2)
	top			= Word(coords, 3)
	width		= Word(coords, 4)
	height		= Word(coords, 5)

	textflow		= Word(params, 1)
	flowdist		= Word(params, 2)
	link			= Word(params, 3)
	transparency	= Word(params, 4)
	lineweight	= Word(params, 5)
	linecolor		= Word(params, 6)
	fillcolor		= Word(params, 7)

	bevel = ""
	IF	(type = 5) THEN
		bevel = "BEVEL"

	/* -------------------------------	*/
	/* Draw the shadow by offsetting	*/
	/* the left and top values.		*/
	/* -------------------------------	*/
	left = left + XOffset
	top	= top + YOffset
	IF	(type = 6) THEN
		DrawOval page left top width height
	ELSE
		DrawBox page left top width height bevel

	/* ---------------------------------------------------	*/
	/* Now Set the object parameters keeping the textflow	*/
	/* flow distance and linked the same as the original	*/
	/* object. Set transparency to solid, lineweight to 	*/
	/* none and the colors to black.					*/
	/* Then send the new object to the background.		*/
	/* ---------------------------------------------------	*/
	shadowId = Result
	SetObjectParams shadowId textflow flowdist link 0 0 black black
	ObjectToBack shadowId

	/* -------------------------------	*/
	/* Unselect the object and redraw.	*/
	/* -------------------------------	*/
	SelectObject 0
	Redraw
	END
