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
 access the Label control script via script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

welterwmi

Germany
2 Posts

Posted - 07/16/2003 :  05:36:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I work with Origin v7.0300.
Is there a possibility to access the text box of the Label Control dialog box from another script?
Background:
I usually work with ~ 25 dataplots in a layer and am looking for very subtle changes. Therefore, I want to be able to choose which and how many dataplots of the layer are shown or hidden by simply clicking on buttons, each button representing a plot.
The buttons (text labels) are created and activated to run the script in the box of their Label Control dialog box in " Button up-mode" by the following script:

layer -c;
for(jj=1;jj<=count;jj++){
%R=%[%Z,#jj];
label -s -n %R %R;
%R.script=1;}

Now I want that in the text box of the Label Control dialog box of each label appears
the following script:

this.color=3-this.color;


(The color of the test labels changes with each click between black and red. This color is used afterwards to determine which plots are to be shown and which are to be hidden)

Till now, I found no possibility to create the same script in all the 25 labels
automatically.

Is there a possibility, or maybe a totally different approach to my problem

I'd be gratefull for any advice

Thanks a lot

Bettina

Mike Buess

USA
3037 Posts

Posted - 07/16/2003 :  08:12:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bettina,

The label control script cannot be read or written by script. However, since all of your buttons will have the same script there are a couple of solutions...

1> Prepare a plot template that already contains the buttons named Text1, Text2, Text3... Create more buttons than you will ever need and hide them all. After data are plotted run this script to activate the buttons...

lay -c;
for(jj=1;jj<=count;jj++) {
%R=%[%Z,#jj];
%T=Text$(jj);
%T.name$=%R; // rename button
%R.show=1; // show button
%R.script=1;
};

2> Save a text button as an object file (OGO) and reuse it as many times as you want...

1. Create a label with the desired script and run-on settings.
2. draw -n labelname -f save %Ylabelname.OGO; // save as OGO
3. Use it like this...

lay -c;
for(jj=1;jj<=count;jj++) {
%R=%[%Z,#jj];
draw -n %R -f read %Ylabelname.OGO; // load and rename label
%R.script=1; // keep this for good measure
};

Perhaps a combination of those solutions might work for you. E.g., use 2 to create the buttons in 1.

Mike Buess
Origin WebRing Member
Go to Top of Page

welterwmi

Germany
2 Posts

Posted - 07/16/2003 :  11:35:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Mike,

The suggested combination of methods 1 and 2 works perfectly.

Many Thanks

Bettina
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