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
 Forum for Origin C
 how can I change the color of a string
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marco.zorcic

Germany
Posts

Posted - 10/18/2006 :  11:08:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

my problems are like this:

I load my graph (a template) and the text is already insert in the layer (in the color gray).
Now I won't to write the text new with the following code.


GraphLayer glSum;
GraphObject goSum;
glSum=gpSumTest.Layers(0);
goSum=glSum.GraphObjects("Text");
strLabelText.Format("f / Ghz \n S11 / dB \n S12 / dB \n S21 / dB \n S22 / dB");
goSum.Text=strLabelText;

And my problem is, I don't know how can I change the color of the string strLabelText



thanks


rlewis

Canada
253 Posts

Posted - 10/18/2006 :  12:05:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try ...

 
int iColor=2; // assign iColor the desired value of the color
string strColor;
strColor.Format("%d",iColor);
string strLTcommand=goSum.GetName()+".color="+strColor;
LT_execute(strLTcommand);
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/18/2006 :  12:06:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This will also work...

goSum.Label.Color.nVal = 1; // 0=black, 1=red, 2=green,...

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/18/2006 12:07:53 PM
Go to Top of Page

marco.zorcic

Germany
Posts

Posted - 10/19/2006 :  02:34:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks to both!

@Mike.
It works fine. Is there anywhere a reference, for this stuff?

@ rlewis

when I execute your code, comes a error message with "TEXT.COLOR isn't a valid name"??

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/19/2006 :  07:58:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Is there anywhere a reference, for this stuff?
Not that I know of. Use out_tree(goSum.Label) to find all Label properties.

quote:
when I execute your code, comes a error message with "TEXT.COLOR isn't a valid name"??
Try glSum.LT_execute(strLTcommand).

Mike Buess
Origin WebRing Member
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