Posted: June 01 2004 at 23:02 | IP Logged
|
|
|
Robert,
Yes...it's not real easy, but it can be done. Basically, you can do all kinds of things using the ph_ccmodify function. Rather than try to detail everything that can be done (that would probably take an entire book), I'll show you a couple of pieces of code that you can experiment with.
The first code will create a new static text object on a Control Center tab:
ph_ccmodify(3,'create text(name=gv_inside_temp pointer="arrow!" band=detail font.charset="0" font.face="Arial" font.family="2" font.height="-10" font.pitch="2" font.weight="400" background.mode="2" background.color="12632256" color="0" alignment="2" border="2" x="2084" y="1936" height="96" width="1000" text="Inside Temperature: ' + ph_getglobal_s("INSIDE_TEMP") + ' degrees.")')
You can see that we are using only the ph_ccmodify function. The first parameter is the tab number you wish to create a control on. In my example, Im using tab number 3. The second parameter is the actual syntax used to create an object. You can experiment around with the values used in this syntax as most are pretty much self explanatory. You should only ever create an object with the same name once. In my example, Im going to use the global variable "INSIDE_TEMP" so Ive named the new text object "gv_inside_temp". Once you've created a new object, you can update its properties. Again you do this with ph_ccmodify, but with a slightly different syntax. In the example below, Im going to update the text with the most current value of the "INSIDE_TEMP" global variable.
ph_ccmodify(3,'gv_inside_temp.text="Inside Temperature: ' + ph_getglobal_s("INSIDE_TEMP") + ' degrees."')
You can see in the above example, Im still using tab 3. I next reference the name that I gave the text object when I created it, "gv_inside_temp". Then using dot notation, I access it's properties, in this case the "text" property.
You would typically use the first function only once when PowerHome is started, such as in the "STARTUP" macro. You could then create a macro that you use to update your global variable and include the second function. As long as you only update the global variable using the macro, the value of the GV will be reflected upon your Control Center tab.
Let me know if you need clarifications or have further questions,
HTH,
Dave.
|