home *** CD-ROM | disk | FTP | other *** search
- /*
-
- blue.cwx
-
- This script turns all objects with the appropriate color property(s) blue.
-
- 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.
-
- */
-
-
- /* Load utility functions. */
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
-
-
- /* Make sure the user wants to do this. */
- if RxMessageBox("This script turns everything blue. Are you feeling blue?", ,
- "Settings","yesno") \= 6 then
- exit
-
-
- call blue CwGetCurrentView()
- exit
-
-
-
-
-
- /* Actually turn the objects blue. */
- blue:procedure
- parse arg root
-
- /* Itterate over all objects in the current view or group. */
- object = CwFindFirstObject(root)
- do while CwIsHandleValid(object)
-
- /* If the object is a group, we recurse into it. Otherwise,
- try to turn it blue. */
- ht = CwGetHandleType(object)
- if ht = "Group" then do
- call blue object
- end
- else do
- tool = CwGetTool(object)
-
- /* See if it has Color. */
- if CwHasProperty(tool, "Color") then do
- call CwSetProperty tool, "Color", "Blue"
- end
-
- /* See if it's a Color-fade.*/
- else if CwHasProperty(tool, "Top-left:HSV Color") then do
- call CwSetProperty tool, "Top-Left:HSV Color", "Blue"
- call CwSetProperty tool, "Top-Right:HSV Color", "Blue"
- call CwSetProperty tool, "Bottom-Left:HSV Color", "Blue"
- call CwSetProperty tool, "Bottom-Right:HSV Color", "Blue"
- end
- end
-
- object = CwFindNextObject(object)
- end
- return
-
-