ph_setccobj PowerHome formula function
Description
Changes the attributes of a Control Center object. You can change all the attributes at once or individual ones depending upon the values you pass
Syntax
ph_setccobj ( as_text, ai_x, ai_y, ai_width, ai_height, al_fcolor, al_bcolor, ai_border )
ph_setccobj ( as_tab, as_id, as_text, ai_x, ai_y, ai_width, ai_height, al_fcolor, al_bcolor, ai_border )
Argument Description
as_tab String (Optional). The ID of the Control Center tab containing the button. If this parameter is omitted, system variable CCTAB will be used
as_id String (Optional). The ID of the object on the specified CC tab. If this parameter is omitted, system variable CCOBJ will be used
as_text String. The text to place on the object. Use "" (empty string) to remove the text. Use a single space " " to not change the text
ai_x Integer . The x position of the object. This is the horizontal position of the upper left corner of the object. Use -1 to not change the x position
ai_y Integer . The y position of the object. This is the vertical position of the upper left corner of the object. Use -1 to not change the y position
ai_width Integer . The width of the object. Use -1 to not change the width
ai_height Integer . The height of the object. Use -1 to not change the height
al_fcolor Long. The foreground color of the object. Use -1 to not change the foreground color
al_bcolor Long. The background color of the object. Use -1 to not change the background color
ai_border Integer. The border of the object. 0 = No border, 2 = Box, 5 = lowered, 6 = raised, and 10 = button. Use -1 to not change the border
Return value
Integer. Returns 0
Usage
Use this function or the individual ph_setcc functions to change the appearance of Control Center objects on the fly. Using this technique, you can make Control Center objects reflect the state of items. Any changes made to the Control Center in this manner are NOT permanent. These changes will be seen in the desktop Control Center as well as the web version of the Control Center.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_setccobj("MAIN","FAMRMLIGHT","On, 100%", -1, -1, -1, -1, 0,rgb(255,255,0), -1) - On Control Center tab MAIN, object FAMRMLIGHT, the displayed text is updated to "On, 100%", the foreground color is set to black, and the background color is set to yellow. Other attributes are unchanged