The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Object /text color
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Maxbrain0

USA
1 Posts

Posted - 09/03/2009 :  10:57:35 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: Origin 8 SR 4
Operating System: Windows XP pro

I have created several LabTalk scripts to follow different import filters that determine from the data whether they pass or fail. I am able to determine the criteria and then display the pass/fail as a string or object on a template plot. I was looking for a way to make make the text or text box to be one color for pass and one color for fail, instead of just displaying the text.

Here's some of examples of what I'm doing at the end of the code and how I need to change the color.

For example
if(gain_30>=gain_3dB && gain_330>=gain_3dB)
page.info.user.variables.bandwidth$ = "PASSES 30 degree,3 dB bandwidth spec";
else
page.info.user.variables.bandwidth$ = "FAILS 30 degree,3 dB bandwidth spec";

if(gain_60>=-15 && gain_300>=-15)
page.info.user.variables.rolloff$ = "PASSES 60 degree,-15 dBi spec";
else
page.info.user.variables.rolloff$ = "FAILS 60 degree,-15 dBi spec";

I then display the desired strings in the template.

I also can do something similar with objects, as follows.

if((stats.max<lim_max))
passfail.text$ = "Passed, data is < $(lim_max)";
else
passfail.text$= "Failed, data is not < $(lim_max)";

Any help is greatly appreciated.

Jacob

greg

USA
1379 Posts

Posted - 09/14/2009 :  10:30:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just use escape sequences to add formatting to your strings. To add color (Blue = Pass, Red = Fail) use:

if(gain_30>=gain_3dB && gain_330>=gain_3dB)
page.info.user.variables.bandwidth$ = "\c4(PASSES 30 degree,3 dB bandwidth spec)";
else
page.info.user.variables.bandwidth$ = "\c2(FAILS 30 degree,3 dB bandwidth spec)";
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000