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
 Legend Update Dialog Formatting Hints Script

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
cdrozdowski111 Posted - 08/08/2013 : 06:32:29 AM
I'm offering the LT code below as a method of providing helpful legend formatting token hints for the Legend Update dialog. It's not sophisticated but does the job. The tokens are based on Origin9.0.0 SR2 so if you have an earlier version, you might need to modify them.

You can put the script in a menu item or toolbar button with this code:

run.section(myscriptfilename.ogs, mylegendupdate);

Here's the script:

// Labtalk wrapper for legendupdate X-Function. Displays formatting tokens in the classic script window
[mylegendupdate]

// Clear script window (optional- may comment out)
type -o new;

// Type tokens to classic script window
type -a "Legend Formatting Tokens";
type -a "========================";
type -a "@C => Column short name.";
type -a "@D => Dataset name.";
type -a "@LA => Long Name, if available, else Short Name.";
type -a "@LC => Comment.";
type -a "@LD<n> => User Parameter. @LD is the same as @LD1, but in order to use @LD2, you will need at least two user defined parameters.";
type -a "@LG => Long Name, if available, else Short Name and Units.";
type -a "@LH => Header (entire header) (NOT CURRENTLY IMPLEMENTED!).";
type -a "@LL => Long Name.";
type -a "@LM => Comments (first line), if present, or Long Name, if present, else Short Name.";
type -a "@LN => Equivalent to @LM + @LU.";
type -a "@LP<n> => Parameter; @LP is the same as @LP1. In order to use @LP2, @LP3, you will need those Parameter rows shown in the worksheet.";
type -a "@LQ<n> => The legend will show the User Parameter + [@LU].";
type -a "@LS => Short Name.";
type -a "@LU => Units, not including Long Name, and without brackets [] or parentheses( ).";
type -a "@R => Full range string.";
type -a "@U => Equivalent to @LG (previous notation).";
type -a "@W => Book Short Name.";
type -a "@WL => Book Long Name.";
type -a "@WS => Sheet name.";

// Clear selections on page
page -s;

// Active first layer
page.active = 1;

int isCancel;

// Open legendupdate X-Function dialog with isCancel switch
legendupdate -dc isCancel;

// Optional legend positioning code (example below)
/*
if (isCancel == 0)
{
	legend.x = layer.x.to - (legend.dx/2);
	legend.y = layer.y.to - (legend.dy/2);
}
*/

// Clear script window (optional- may comment out)
type -o new;

// Hide script window
type -h;

return (isCancel == 0);
// End section

1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 08/26/2013 : 10:22:22 AM
We are implementing a list like this in 9.1. When you select Custom for "Auto Legend Translation Mode" there will be a flyout button which gives you a similar list and each selection will add to the Legend substitution string.
Much better than those cryptic @strings. Thanks for the suggestion.

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