home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 November / PCO_1198.ISO / filesbbs / os2 / tspg202s.arj / TSPG202S.ZIP / Scripts / BLUE.CWX < prev    next >
Encoding:
Text File  |  1997-05-04  |  1.7 KB  |  69 lines

  1. /*
  2.  
  3.   blue.cwx
  4.  
  5.   This script turns all objects with the appropriate color property(s) blue.
  6.  
  7.  Copyright 1997 by TrueSpectra Inc.                                  
  8.                                                                      
  9.  This code is provided purely for demonstration purposes and is not  
  10.  supported or under warranty.  Feel free to modify and examine this  
  11.  example script for your own purposes.                               
  12.  
  13. */
  14.  
  15.  
  16. /* Load utility functions. */
  17. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  18. call SysLoadFuncs
  19.  
  20.  
  21. /* Make sure the user wants to do this. */
  22. if RxMessageBox("This script turns everything blue.  Are you feeling blue?", ,
  23.     "Settings","yesno") \= 6 then 
  24.         exit
  25.  
  26.  
  27. call blue CwGetCurrentView()
  28. exit
  29.  
  30.  
  31.  
  32.  
  33.  
  34. /* Actually turn the objects blue. */
  35. blue:procedure
  36. parse arg root
  37.  
  38. /* Itterate over all objects in the current view or group. */
  39. object = CwFindFirstObject(root)
  40. do while CwIsHandleValid(object)
  41.  
  42.     /* If the object is a group, we recurse into it. Otherwise,
  43.        try to turn it blue. */
  44.     ht = CwGetHandleType(object)
  45.     if ht = "Group" then do
  46.         call blue object
  47.         end
  48.     else do
  49.         tool = CwGetTool(object)
  50.         
  51.         /* See if it has Color. */
  52.         if CwHasProperty(tool, "Color") then do
  53.             call CwSetProperty tool, "Color", "Blue"
  54.             end
  55.     
  56.         /* See if it's a Color-fade.*/
  57.         else if CwHasProperty(tool, "Top-left:HSV Color") then do
  58.             call CwSetProperty tool, "Top-Left:HSV Color", "Blue"
  59.             call CwSetProperty tool, "Top-Right:HSV Color", "Blue"
  60.             call CwSetProperty tool, "Bottom-Left:HSV Color", "Blue"
  61.             call CwSetProperty tool, "Bottom-Right:HSV Color", "Blue"
  62.             end
  63.         end
  64.  
  65.     object = CwFindNextObject(object)
  66.     end
  67. return
  68.  
  69.