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
 Origin Forum
 Attach existing labels/buttons to new layers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 09/02/2002 :  06:31:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 09/02/2002 :  09:16:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 09/02/2002 :  10:02:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

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