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
 Frame dimensions textbox

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
DHX Posted - 02/06/2013 : 03:48:29 AM
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!
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 02/07/2013 : 2:51:20 PM
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;
}
DHX Posted - 02/07/2013 : 09:41:33 AM
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.

Penn Posted - 02/06/2013 : 04:48:13 AM
Hi,

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

mylabel.fsize = 30;


Penn

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