| T O P I C R E V I E W |
| welterwmi |
Posted - 07/16/2003 : 05:36:50 AM 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
|
| 2 L A T E S T R E P L I E S (Newest First) |
| welterwmi |
Posted - 07/16/2003 : 11:35:01 AM Hello Mike,
The suggested combination of methods 1 and 2 works perfectly.
Many Thanks
Bettina |
| Mike Buess |
Posted - 07/16/2003 : 08:12:12 AM 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 |
|
|