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
 Frame dimensions textbox
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

DHX

2 Posts

Posted - 02/06/2013 :  03:48:29 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

If I create a textbox and set the background in the properties to "Black Line" I get a nice frame around the textbox. By manually clicking onto the frame line I am able to resize the frame.

My question is: Is it also possible to resize the frame via the script window?

I can disable/enable the frame completely with the command:
mylabel.background=0/1

But even after some searching I didn't find a way to achieve resizing of the frame.

The problem is that sometimes Origin messes up theses frames and if that happens it is impossible to resize all frames in all graphes to exactly the same size manually.

Help would be really appreciated, thank you!

Penn

China
644 Posts

Posted - 02/06/2013 :  04:48:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can change the font size, and then the frame is changed with the font size, such as

mylabel.fsize = 30;


Penn
Go to Top of Page

DHX

2 Posts

Posted - 02/07/2013 :  09:41:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

thank you for your reply but this is not quite what I meant. With a click of the mouse directly onte the frame you can resize it independently from the font size (see attached picture). And this is what I need to control through Labtalk. Because if I assign a position of a label via Labtalk (mylabel.x1=50) not the frame but the text itself is set to this position. That would be ok in principle but if I try to position two labels to exactly the same x-position and the frames of two labels differ just a little there is no way to allign the frames of the labels.

Go to Top of Page

greg

USA
1378 Posts

Posted - 02/07/2013 :  2:51:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You cannot access frame properties through script, but positioning of a text object takes into account whether the background is on or not and you can use the X, Y, DX and DY properties of the object to position.

Oddly, the x,y metric used by the label -a command refers to the top-left of a text object while the x,y properties refer to the center:

win -t plot origin;
cx = (x1 + x2) / 2;
cy = (y1 + y2) / 2;
draw -l -v cx;
draw -l -h cy;
label -a cx cy -n MyText Hello World;
mytext.fsize = 42;
sec -p 1;
MyText.x = cx;
MyText.y = cy;
sec -p 1;
mytext.background = 1;
// Use DX and DY properties (width and height) to position by edge
repeat 7 {
mytext.background = 1 - mytext.background;
mytext.x = X1 + mytext.DX / 2;
mytext.y = Y2 - mytext.dy / 2;
sec -p 1;
}
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