General Extension Script Editing

 

Selecting extension elements such as width, height, X position, Y position, etc. will display settings windows such as <Figure 1>, <Figure 2>, <Figure 3>, <Figure 4>, etc. The method of setting can be chosen between basic conversion and script conversion. <Table 1> describes the script content (return values) and script writing examples of the extension features.

Extension Elements Script Content (return values) Script Writing Examples Possible Graphic Elements
Size Width % value of width/height return 100;   // original size
return 50;     // half size
return 200;   // double size
Most graphic elements
Height
Position X X/Y coordinate values return 75;
return 500;
return 1000;
Y
Event When key pressed Content to execute when key is pressed if(@KeyGetCode() == 13) {
    // Enter key pressed
}
Input device
When selection changes Content to execute when selection changes i=@ListBoxGetCurSel(¡°ListBox1¡±);
// Used to get information on window controls using functions
List box, combo box, radio button, check box, etc.
Mouse Response When left button pressed Content to execute when mouse button is pressed or released  



Common graphic elements like lines, rectangles, etc.
When left button released
When right button pressed
When right button released
View Display ON(1)/OFF(0) value return ON;   // display
return OFF;  // do not display
Most graphic elements
Blink Blink period value (0 = None, 1000 = Every second) return 0;        // do not blink
return 1000;   // blink every second
Rotate Rotation angle value (90 = 90 degrees, 180 = 180 degrees) return 90;     // rotate 90 degrees
return 180;   // rotate 180 degrees
Animation Speed Revolutions per minute (RPM) return 30;     // 30 times per minute
return 100;   // 100 times per minute
Animation
Thickness Line thickness Thickness value of the line return 1;   // line thickness = 1
return 3;   // line thickness = 3
Related to lines, rectangles, polygons, curves, rounded rectangles, etc.
Color Line color Line color value return @RGB(255, 255, 255);    // white
return @RGB(0, 0, 0);              // black
return @RGB(0, 0, 255);          // blue
return @ARGB(127, 0, 0, 255); // 50% transparent red
Elements related to lines
Fill color Fill color value Elements related to fill
Text color Text color value Elements related to text
Background color Background color value Elements with background

<Table 1> Examples and content of writing extension scripts

 

<Figure 1> Example of running the width extension feature edit window

 

When using the basic conversion of the width extension feature, the method of setting is as follows.

Tag: Set the tag you want to set as the return value.

Tag value range and conversion value range: Set to convert the tag value to apply as the return value.

Direction: Set the direction to increase the width.

Left->Right: Increase the width to the right based on the left of the graphic element.

Center->Left and Right: Increase the width equally to the left and right based on the center of the graphic element.

Right->Left: Increase the width to the left based on the right of the graphic element.

 

<Figure 2> Example of running the height extension feature edit window

 

When using the basic conversion of the height extension feature, the method of setting is as follows.

Tag: Set the tag you want to set as the return value.

Tag value range and conversion value range: Set to convert the tag value to apply as the return value.

Direction: Set the direction to increase the height.

Top->Bottom: Increase the height downward based on the top of the graphic element.

Center->Up and Down: Increase the height equally upward and downward based on the center of the graphic element.

Bottom->Top: Increase the height upward based on the bottom of the graphic element.

 

<Figure 3> Example of running the position-X extension feature edit window

 

When using the basic conversion of the position-X extension feature, the method of setting is as follows.

Tag: Set the tag you want to set as the return value.

Tag value range and conversion value range: Set to convert the tag value to apply as the return value.

Direction: Set the direction to move the X coordinate.

Screen coordinates: Set to move the X coordinate using absolute screen coordinates regardless of graphic elements.

Object->Right: Set to move the X coordinate to the right of the graphic element.

Object->Left: Set to move the X coordinate to the left of the graphic element.

 

<Figure 4> Example of running the position-Y extension feature edit window

 

When using the basic conversion of the position-Y extension feature, the method of setting is as follows.

Tag: Set the tag you want to set as the return value.

Tag value range and conversion value range: Set to convert the tag value to apply as the return value.

Direction: Set the direction to move the Y coordinate.

Screen coordinates: Set to move the Y coordinate using absolute screen coordinates regardless of graphic elements.

Object->Bottom: Set to move the Y coordinate to the bottom of the graphic element.

Object->Top: Set to move the Y coordinate to the top of the graphic element.

 

<Figure 5> Example of running the mouse response-when left button pressed extension feature edit window

 

Event-when key pressed, event-when selection changes, mouse response-when left button pressed, mouse response-when left button released, mouse response-when right button pressed, mouse response-when right button released extension feature edit windows are all similar to <Figure 5>, and only script conversion is possible without basic conversion.

 

<Figure 6> shows an example of executing the display extension function edit window.

 

Here is how to set up the display extension function for basic conversion:

Tag: Set the tag that serves as the basis for the display conditions.

Display Condition: Set the condition for displaying the graphic element.

 

<Figure 7> shows an example of executing the blink extension function edit window.

 

Here is how to set up the blink extension function for basic conversion:

Tag: Set the tag that serves as the basis for the blink conditions.

Blink Condition: Set the condition for blinking the graphic element.

Blink Cycle: Set the blink cycle of the graphic element in milliseconds.

 

<Figure 8> shows an example of executing the rotation extension function edit window.

 

Here is how to set up the rotation extension function for basic conversion:

Tag: Set the tag you want to use as the return value.

Tag Value Range and Conversion Value Range: Set the range to convert the tag value to the return value.

Rotation Direction: Set the rotation direction of the graphic element.

Rotation Axis: Set the axis that serves as the basis for the rotation.

 

<Figure 9> shows an example of executing the speed extension function edit window.

 

Here is how to set up the speed extension function for basic conversion:

Tag: Set the tag you want to use as the return value.

 

<Figure 10> shows an example of executing the line thickness extension function edit window.

 

Here is how to set up the line thickness extension function for basic conversion:

Tag: Set the tag you want to use as the return value.

 

<Figure 11> shows an example of executing the line color extension function edit window.

 

The color extension function edit windows for line color, fill color, text color, and background color are all similar to <Figure 11>. You can specify multiple conditions in the basic conversion of color-related extension functions.

 

Here is how to set up the color extension functions (line color, fill color, text color, background color) for basic conversion:

Add: Add conditions for changing the color of the graphic element.

Delete: Delete the added condition.

Move Up: Move the selected condition up the list. (The conditions at the top of the list have higher execution priority.)

Move Down: Move the selected condition down the list. (The conditions at the bottom of the list have lower execution priority.)

 

Enable: Enable/disable the selected condition.

Tag: Set the tag that serves as the basis for the color change condition.

Condition and Value: Set the condition for changing the color of the graphic element.

Color: Set the color you want to change to.

 

Note) The extension elements 'Mouse Response | Area Display', 'Slider | Horizontal Movement', 'Slider | Vertical Movement' do not use the script editor but are entered in the setting dialog.

 

Related Helps

How to Use the Script Editor

How to Write Scripts

Area Display

Types of Scripts

Scripts for Each Graphic Element

Executing Scripts

Main Script Help