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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 multiline label centering with LabTalk

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tbinford Posted - 06/03/2003 : 11:26:36 AM
Help:

I am trying to format an Origin7 graph using LabTalk. I want to make a multiline label (say a title) and center the text. In a script window, the following does not work:

label -j 1 -sa -n MYTITLE This is a\nCentered Multiline Label;
doc -uw;


None of the -j n options seem to work.

Thanks,
Tommy
6   L A T E S T    R E P L I E S    (Newest First)
tbinford Posted - 06/03/2003 : 12:37:53 PM
Mike:

Thanks for the help. This will do just fine.

Tommy
Mike Buess Posted - 06/03/2003 : 12:07:31 PM
Hi Tommy,

The only way I can think of to change the justification of an existing label is to remove and recreate it. Once you've got your left-justified label called MYTITLE, you use this to center it...

%Z=MYTITLE.text$; // get text
label -r MYTITLE; // delete label
label -s -sa -j 1 -n MYTITLE %Z; // recreate center-justified.

That may not be exactly what you're looking for but it should work.


Mike Buess
Origin WebRing Member
tbinford Posted - 06/03/2003 : 11:58:37 AM
Mike:

You are correct. The LabTalk Manual states the last option must be -n. It also seems that the label command, when using the option switches, is only good for creating a label. Therefore, executing the code

label -sa -j 0 -n MYTITLE "Some text\nand another line of text";

followed by

label -sa -j 1 -n MYTITLE "Some text\nand another line of text";

does not change the justification. Is this correct?

Tommy
Mike Buess Posted - 06/03/2003 : 11:49:48 AM
I got the order wrong myself last time. this works...

label -sa -j 1 -n MYTITLE "This is a\nCentered Multiline Label";

...However, you seem to be right about not being able to change the justification of an existing label.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/03/2003 11:58:56 AM
tbinford Posted - 06/03/2003 : 11:43:12 AM
Actually, I just discovered part of the problem. The -j n option doesn't seem to have an effect on a label which has been created. If a label already exists, then the justification cannot be modified the way I am doing it. For a brand new label, this produces the desired result:

label -j 1 -sa -n NEWLABEL This is a\ncentered multiline label;

However, the following does not change the label to left justified.

label -j 0 -sa -n NEWLABEL This is not a\nleft-justified multiline label;

I'm sure there is just something silly I have neglected to do. Please advise.

Best,
Tommy
Mike Buess Posted - 06/03/2003 : 11:40:23 AM
Hi Tommy,

Option order is important with the label command. Try this...

label -sa -n MYTITLE -j 1 "This is a\nCentered Multiline Label";

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000