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
 User Defined Buttons in Origin 5.0
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

chaskard

Australia
1 Posts

Posted - 12/23/2001 :  11:06:54 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

Can anyone tell me how to add in a button(or menu option) with Origin 5.0? I am only just starting to try and write script. I am confused by the manuals I have and nothing I've tried works.

Thanks heaps!

Laurie

USA
404 Posts

Posted - 12/31/2001 :  09:06:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You need to look at the LabTalk Resources page. Here you'll find lots of useful sample scripts to get you started.

The information below comes from the on-line help, searching on 'button'.

Buttons can be created from any label. In the following example, you create a button from a text label and define the button to open a dialog box containing the message "Hello World!".

Creating the Text Label

1) Click the New Graph button on the Standard toolbar to open a new graph window.

2) Open the Tools toolbar by selecting View:Toolbars. Select the Toolbars check box and click Close.
3) Select the Text tool from the Tools toolbar.

4) Click in a blank area of the graph window. This action opens the Text Control dialog box. Type Hello in the text box.
5) Click OK to close the dialog box. The Hello text label displays on the screen.

Changing the Label into a Button

1) Select Edit:Button Edit Mode to enter Button Edit Mode. This menu command is checked when in Button Edit Mode.
2) Click once on the Hello text label to select it, then select Format:Label Control. This menu command opens the associated Label Control dialog box.
3) Click in the text box at the bottom of the dialog box and type in the following text (this is the script for the control):

type -b "Hello World";

Selecting the Script Execution Option

1) Select Button Up from the Script, Run After drop-down list.

The Button Up option informs Origin that the script is executed when the button is clicked. Each of the options from the Script, Run After drop-down list establish a different method for script execution. For example, select Moved to execute the associated script when the text label is moved.

2) Click OK to close the dialog box. If you are in Button Edit Mode, select Edit:Button Edit Mode to exit the editing mode. The Hello text label now displays on your screen as a button. When you click the button, an Attention dialog box opens and displays "Hello World!".
3) Click OK to clear the Attention dialog box from the screen.

OriginLab Technical Support
Go to Top of Page

Lorraine

USA
66 Posts

Posted - 12/31/2001 :  09:18:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Also, here's another resource you can use in Origin. Please visit one of our knowledge base items regarding the Custom Routine button:

http://www.originlab.com/www/support/resultstech.asp?ItemID=655&VersionID=All&TitleID=Executing+Your+LabTalk+Script+from+the+Custom+Routine+Button&CatID=LabTalk+Tip&TypeID=Script

Lorraine
OriginLab Technical Support
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