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
 Origin Forum
 Attach existing labels/buttons to new layers

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
peter.cook Posted - 09/02/2002 : 06:31:36 AM
HI,

Can existing buttons and labels be attached to different layers via labtalk eg I may have 24 layer temp[lates with 3 buttons attached per layer that I would like to later so that all buttons are attached to layer1?

Cheers,

Pete

2   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 09/02/2002 : 10:02:07 AM
Hi Mike,

Thanks - this is v helpful and exactly what I needed. Save as .ogo and opening just didn't occur. Minor modification to the code used to retain previous postions eg

oldtop=button.top;
oldleft=button.left;

then

newbutton.top=oldtop;
newbutton.left=oldleft;

Thanks again,

Pete

Mike Buess Posted - 09/02/2002 : 09:16:15 AM
Hi Pete,

Note: The following describes how to move a button that runs a script. For simple text labels just copy the text (%Z=labelname.text$), remove the label and recreate it on layer 1.

There is no Labtalk "move" command, but this is how I would move a button named btn1 from layer 2 to layer 1 using Labtalk...

page.active=2; // activate layer 2
draw -n btn1 -f save %Ybtn.ogo; // save btn1 as the object file btn.ogo
label -r btn1; // remove btn1 from layer 2
page.active=1; // activate layer 1
draw -n btn1 -f read %Ybtn.ogo; // create an object from btn.ogo and name it btn1

If you've named the buttons systematically (e.g., btn1, btn2, btn3 for each layer) then you could embed those scripts inside a couple of loops...

loop(ii,2,24) {
loop(jj,1,3) {
page.active=ii;
draw -n btn$(jj) -f save %Ybtn.ogo;
label -r btn$(jj);
page.active=1;
draw -n L$(ii)btn$(jj) -f read %Ybtn.ogo;
};
};

...You'd end up with buttons btn[1-3], L2btn[1-3], ..., L24btn[1-3] on layer 1.

Moving objects between layers (or windows) should be more straigtforward in OriginC, but I don't know how yet. Anyone else?

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/02/2002 09:37:51 AM

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