8.6.5.6 The (Object Properties) Programming tab


Object Properties Programming tab.png

Name

A text object may be named, enabling Origin to identify the object during execution of built-in or user-defined scripts. Unnamed labels are only affected by scripts entered in the object's Programming Control dialog box (See the Script text box, below). To name a text object, enter a name in the Name text box.

Warning: Some labels -- such as the legend and the axis titles -- are named by Origin. In most cases, you will not want to rename legends and axis titles; doing so will cause menu commands that update the labels to stop working or to create duplicate labels. One reason why you might want to rename the graph legend: You have customized the legend and you want to ensure that your customizations are not overwritten.

The Attach To Group

To control the effect of layer manipulation and axis rescaling on the label's size and position, select one of the following radio buttons:

Page. When attached to the page, the label is both position and scale independent of its layer. The label position and size are not affected by moving or resizing the layer, or by changing the axis scale. The label is still a part of the layer, however, and is deleted if the layer is deleted.

Layer Frame. When attached to the layer frame, the label is position dependent on its layer. When you move the layer, the label moves with the layer. If you resize the layer, the label changes dimensions proportionally and moves with the layer. If you rescale the axes, however, the label does not change size or position.

Layer and Scales. When attached to the layer and scales, the label is connected to the layer in terms of size and position. If you move the layer, the label moves with the layer. If you resize the layer, the label changes dimensions proportionally and moves with the layer. If you rescale the axes, the label size does not change, but the label moves so that it maintains the same XY coordinate value.

The Link to (%,$), Substitution Level Drop-down List

This drop down list is only useful in the Label Control dialog box of a text label. Select options to determine how data or variables will display in the message displayed by the text label. Each time Origin redraws the label, the label is updated to reflect any changes made to the data or variables signified within.

See the screenshots for the longname of workbook which will be referenced by the sample expressions

400

Option Action Example: %(1) Example: %(2)
0 No link Substitude 0.png Substitude 0 2.png
1 Literally appear the substitution in the link Substitude 1.png Substitude 1 2.png
2 Link and resolve only first level Substitude 2.png Substitude 2 2.png
3 Link and resolve up to two levels Substitude 2.png Substitude 3 2.png

To use the drop down list, proper notation conventions must be followed in the associated text label. Basic notation conventions are listed in Linking Text Labels to Data and Variables.

Visible

When Visible is checked, you can open the label's Properties dialog by double-clicking on the label. The label can also be moved and resized.

When this check box is cleared, the label is not visible and its Properties dialog box cannot be accessed by double-clicking on the label. Instead, you must enter Edit Mode (Edit: Edit Mode) to show the label, then double-click on it to open Properties. After editing the label, exit Edit Mode by again selecting Edit: Edit Mode.

Selectable

When the Selectable check box is cleared, restrict selection or movement of the label entirely. This option is useful when using a label as a backdrop to a page or layer. When not Selectable, you cannot use the ALT+double-click shortcut to edit the dialog box. Instead, enter Edit Mode (Edit: Edit Mode), click on the label, and select Format:Object Properties.

Real-Time

Available for drawn objects only. Select the box to update the object in real-time whenever there is a real-time plotting event.

The Script, Run After Drop-down List

The option selected from this drop-down list defines the circumstances required for script execution. Enter the script to be executed in the associated text box beneath this drop-down list.

Option Script Execution Method
None Do not execute script.
Button Up Execute script when button is clicked.
Moved Execute script when button is moved.
Sized Execute script when button is resized.
Moved or Sized Execute script when button is moved or resized.
Redrawn Execute script when button is redrawn.
Real-Time Execute script when a real-time event occurs. These events are typically generated through DDE data transfer or from a Data Acquisition module.
Window Create Execute script when the button's window first opens.
Window Close Execute script when the button's window closes.
Window Activate Execute script when the button's window becomes active.
Window Deactivate Execute script when the button's window becomes inactive.
New Selection Execute script when unselected button is clicked.
Before Save Execute script immediately before saving the project.
Axes Rescale Execute script when graph axes rescale.
All Events Execute script when any one of the previous events occur.
Mask Change Execute script when masking data change.
Data Change Execute script when data updated.

The (Script) Text Box

To associate a script with an object, type the script directly in this text box or copy and paste it from any text editor.

For instance, you can enter LabTalk or Python script in the box and run it with one of these triggers.

  • Each LabTalk statement in the script must end with a semicolon (does not apply to Python).
  • ENTER is a simple carriage return.
  • To add a tab within the text box, use CTRL + TAB.