Tool Functions
[Functions]


Functions

void Button (string Name, string ToolTip)
 Create a button tool.
scalar CheckBox (string Name)
 Evaluate a check box tool.
scalar CheckBox (string Name, scalar Init, string ToolTip)
 Create a check box tool.
scalar Choice (string Name)
 Evaluate a combo box tool.
scalar Choice (string Name, list Elts, counter Init, string ToolTip)
 Create a combo box tool.
scalar Input (string Name)
 Evaluate an input tool.
scalar Input (string Name, scalar Min, scalar Max, scalar Init, string ToolTip)
 Create an input tool.
string InputText (string sName)
 Evaluate a text input tool.
string InputText (string sName, counter bCallback, string sText, string ToolTip)
 Create a text input tool.
scalar Slider (string sName)
 Evaluate a stepper tool.
scalar Slider (string Name, scalar Min, scalar Max, scalar Step, scalar Init, string ToolTip)
 Create a slider tool.
scalar Stepper (string sName)
 Evaluate a stepper tool.
scalar Stepper (string sName, scalar dMin, scalar dMax, scalar dStep, scalar dLargeStep, scalar dInit, string ToolTip)
 Create a stepper tool.

Detailed Description

The functions described here create tools which are displayed in a window attached to the visualization. This allows the generation of simple dialog boxes, which can improve the user interactivity of a visualization. For more details on how to use tools see User Interaction with Tools.

Function Documentation

void Button string  Name,
string  ToolTip
 

Create a button tool.

Parameters:
Name The name of the tool.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
nothing.
Since:
v2.0
This function creates a button tool. For example, the code

    Button("Show Sphere");

creates a tool that looks like this

ButtonExample1.jpg

The name of the button is drawn inside it. When a button is pressed the script is reexecuted with ExecMode set to EM_TOOL and ToolName set to the name of the button tool. See also User Interaction with Tools for more details and examples.

scalar CheckBox string  Name  ) 
 

Evaluate a check box tool.

Parameters:
Name The name of the tool.
Returns:
The current value of the named check box.
Since:
v1.5
This function retrieves the value of a previously created check box. See also User Interaction with Tools for more details and examples.

scalar CheckBox string  Name,
scalar  Init,
string  ToolTip
 

Create a check box tool.

Parameters:
Name The name of the tool.
Init The initial value of the check box.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
1 if check box is selected and 0 if not.
Since:
v1.5
This function creates a check box tool. For example, the code

    CheckBox("Show Sphere", 0);

creates an input that looks like this

CheckBoxExample1.jpg

The title is drawn on top. The initial value of the check box is given by Init. If the Init is zero, the check box is not selected, otherwise it is selected. The return value is 1 for a selected check box and 0 for an unselected check box. See also User Interaction with Tools for more details and examples.

scalar Choice string  Name  ) 
 

Evaluate a combo box tool.

Parameters:
Name The name of the tool.
Returns:
The current value of the named combo box.
Since:
v2.0
This function retrieves the value of a previously created combo box. See also User Interaction with Tools for more details and examples.

scalar Choice string  Name,
list  Elts,
counter  Init,
string  ToolTip
 

Create a combo box tool.

Parameters:
Name A string representing the name of the tool.
Elts A list from that an element is to be choosen.
Init A counter specifying an initial element from the list.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
The selected element.
Since:
v2.0
The following code first creates a circle C. After that it is decomposed via function FactorizeBlade into two orthogonal spheres. The user may now select the sphere that shall be displayed.

    DefVarsN3();
    :IPNS;
    :Red;
    :P1 = VecN3(1,-2,3);
    :P2 = VecN3( 3,-1,4);
    :P3 = VecN3( 2,7,-1);
    :C = (P1 ^ P2 ^ P3) * I:Yellow;
    L = FactorizeBlade( C );     // C ~ 'L(1) ^ L(2)'.
    c = Choice("Spheres", L, 1);
    :L(c):Blue + Alpha + Alpha;  // Display one of the spheres.
The combo box will appear at the bottom of the visualization window and might look like this if the user opened it:

Choice_img1.jpg

scalar Input string  Name  ) 
 

Evaluate an input tool.

Parameters:
Name The name of the tool.
Returns:
The current value of the named input tool.
Since:
v1.5
This function retrieves the value of a previously created input tool. See also User Interaction with Tools for more details and examples.

scalar Input string  Name,
scalar  Min,
scalar  Max,
scalar  Init,
string  ToolTip
 

Create an input tool.

Parameters:
Name The name of the tool.
Min The minimum value of the input.
Max The maximum value of the input.
Init The initial value of the input.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
The currently entered value.
Since:
v1.5
This function creates an input tool. For example, the code

    Input("Radius", 0, 2, 1);

creates an input that looks like this

InputExample1.jpg

The title is drawn on top, while the current value is displayed in the input field. The minimum and maximum allowed values are set by Min and Max, respectively. The initial value of the input is given by Init. See also User Interaction with Tools for more details and examples.

string InputText string  sName  ) 
 

Evaluate a text input tool.

Parameters:
sName The name of the tool.
Returns:
The current string value of the named text input tool.
Since:
v2.2
This function retrieves the string value of a previously created input tool. See also User Interaction with Tools for more details and examples.

string InputText string  sName,
counter  bCallback,
string  sText,
string  ToolTip
 

Create a text input tool.

Parameters:
sName The name of the tool.
bCallback If this is not zero (true), then the corresponding CLUScript is re-executed each time the user enters or deletes a letter. If this value is zero, then the script is only-reexecuted when the user presses return.
sInit The initial string value of the input.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
The currently entered string.
Since:
v2.2
This function creates a text input tool. See also User Interaction with Tools for more details and examples.

scalar Slider string  sName  ) 
 

Evaluate a stepper tool.

Parameters:
sName The name of the tool.
Returns:
The current value of the named stepper.
Since:
v2.2
This function retrieves the value of a previously created stepper. See also User Interaction with Tools for more details and examples.

scalar Slider string  Name,
scalar  Min,
scalar  Max,
scalar  Step,
scalar  Init,
string  ToolTip
 

Create a slider tool.

Parameters:
Name The name of the tool.
Min The minimum value of the slider.
Max The maximum value of the slider.
Step The step width of the slider.
Init The initial value of the slider.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
The currently selected value.
Since:
v1.5
This function creates a slider tool. For example, the code

    Slider("Radius", 0, 2, 0.1, 1);

creates a slider that looks like this

SliderExample1.jpg

The title is drawn on top, while the current value is displayed to the left of the slider. When the slider is moved into its left most position, it takes on the value Min. At its right most position its value is Max. The values in between can only be selected in steps of Step. The initial value of the slider is given by Init. See also User Interaction with Tools for more details and examples.

scalar Stepper string  sName  ) 
 

Evaluate a stepper tool.

Parameters:
Name The name of the tool.
Returns:
The current value of the named stepper.
Since:
v1.5
This function retrieves the value of a previously created stepper. See also User Interaction with Tools for more details and examples.

scalar Stepper string  sName,
scalar  dMin,
scalar  dMax,
scalar  dStep,
scalar  dLargeStep,
scalar  dInit,
string  ToolTip
 

Create a stepper tool.

Parameters:
sName The name of the tool.
dMin The minimum value of the stepper.
dMax The maximum value of the stepper.
dStep The small step width of the stepper.
dLargeStep The large step width of the stepper.
dInit The initial value of the stepper.
ToolTip (optional) A descriptive text that appears when the user places the mouse over the tool.
Returns:
The currently selected value.
Since:
v2.2
This function creates a stepper tool. For example, the code

    Stepper("Radius", 0, 1, 0.01, 0.1, 0.5);

creates a stepper that looks like this

StepperExample1.jpg

The title is drawn on top, while the current value is displayed in the middle of the stepper tool. Clicking on the single arrows changes the current value by a small step, while clicking on the double arrows changes the current value by a large step. See also User Interaction with Tools for details and examples.