home *** CD-ROM | disk | FTP | other *** search
- /*
-
- regshad.cwx
-
- Creates a typical drop-shadow for text. Objects may need to be rearranged afterward.
- Object with text region must be selected.
-
- Copyright 1997 by TrueSpectra Inc.
-
- This code is provided purely for demonstration purposes and is not
- supported or under warranty. Feel free to modify and examine this
- example script for your own purposes.
-
- */
-
-
-
-
- handle = CwGetSelectedObject()
-
- /* no object selected */
- if \CwIsHandleValid(handle) then do
- say "No object selected."
- exit
- end
-
- /* object must be block text or headline text */
- temp = CwGetProperty(handle, "Region type")
- if temp \= "Headline Text" & temp \= "Block Text" then do
- say "Selected object must be text, not" temp
- exit
- end
-
- duphandle = CwDuplicateObject(handle)
-
- Ycenter = CwGetProperty(duphandle, "Position:Y Center")
- Xcenter = CwGetProperty(duphandle, "Position:X Center")
-
- Height = CwGetProperty(duphandle, "Position:Height")
- Width = CwGetProperty(duphandle, "Position:Width")
-
- /* move the line of text down one tenth of the object size */
- Ycenter = Ycenter - Height / 25
- Xcenter = Xcenter + Height / 25
-
- call CwSetProperty duphandle, "Position:Y Center", Ycenter
- call CwSetProperty duphandle, "Position:X Center", Xcenter
-
- /* make object black */
- call CwSetRegion duphandle, "Custom Region"
- call CwSetTool duphandle, "Solid Color"
- handle2 = CwGetTool(duphandle)
-
- red = CwGetProperty(handle2, "Color:Red")
- green = CwGetProperty(handle2, "Color:Green")
- blue = CwGetProperty(handle2, "Color:Blue")
-
- red = 0
- green = 0
- blue = 0
-
- call CwSetProperty handle2, "Color:Red", red
- call CwSetProperty handle2, "Color:Green", green
- call CwSetProperty handle2, "Color:Blue", blue
-
- regview = CwGetRegion(duphandle)
- view2 = CwGetView(regview)
-
- call CwCopy handle
- call CwSelectView view2
- call CwPaste
-
- iv1 = CwFindFirstObject(CwGetCurrentView())
- iv2 = CwDuplicateObject(iv1)
-
- call CwSetPosition iv1, Xcenter, Ycenter, Width, Height, 0, 0
- call CwSetTool iv1, "Solid Color"
-
- call CwSetPosition iv2, Xcenter, Ycenter, Width, Height, 0, 0
- call CwSetRegion iv2, "Rectangle"
- call CwSetTool iv2, "Blur"
-
- red = 128
- green = 128
- blue = 128
-
- iv3 = CwGetTool(iv1)
- call CwSetProperty iv3, "Color:Red", red
- call CwSetProperty iv3, "Color:Green", green
- call CwSetProperty iv3, "Color:Blue", blue
-
-
- call CwMoveObjectBehindObject duphandle , handle