Action Tools Overview
- Jonas Hall
In GeoGebra there are a few tools that are considered to be action tools. These are sliders, check boxes, input boxes and buttons. This page will give an overview of what these object typically do. The construction below shows the "modern" view of the Algebra window while the screencast at the bottom of this page shows the "Classic" view. (This side originally created by Jonas Hall)
When to use
These tools are useful when you want to have more user interaction. Sliders are graphical representations of numbers. They enable you to easily change a number by dragging a point on a segment. Check Boxes are graphical representations of Boolean variables, i.e. variables that can take be either true or false. Input Boxes are another way to enable users to set the value of an object. It can be a good way of accurately setting the value of a number, but you can also let the user specify functions, expressions, text etc. Buttons contain scripts. When you click a button a sequence of commands are executed. This allows you to let the user do pre-defined actions.
How do you do this?
The construction above uses the following KEY ELEMENTS:
- Two numbers: Numbers can either be created using the Slider Tool or by simply entering a variable namne and a value, e.g. a = 10, MaxValue = 34 etc. If you use the second method no slider is visible in the graphics window until you make it visible by clicking the visibility button in the Algebra window. In the Classic version of GeoGebra, no slider is ever visible in the Algebra window but in the modern versions you have the slider always available in the Algebra window.
- Two input boxes: An input box is connected to an object, allowing the user to change the value or definition of that object. Click on the Input Box tool and then click roughly where you want the box. You can move it later by dragging with the right mouse button. Please note that the Min and Max values of the number, as evident in the sliders, are also limiting the range of values you can input through the input box. Changing the number e.g. by entering a = 57 in the Input Field overrides this and changes the sliders Min or Max value to reflect this.
- A Check Box: In its simplest form, a check box can control the visibility of several objects simultaneously. When created, you are asked what objects you want to control. But in reality, the check box really controls a Boolean variable, here called c and its only possible values are either true or false. This Boolean variable can control many other things as well, but in the simple default case, the name of the variable, "c", is automatically entered into the Conditional Visibility Field in the Advanced tab of those object's properties that you wanted to control. This can be done manually at any time as is shown in the screencast below, where the button is added later. Still we can let the buttons visibility be controlled by the checkbox by going into the buttons properties.
- A Button: A button simply contains a list of commands that are executed when you click the button. Here we create a button to reset the values of variables a and b to 0. In the Button dialog we enter the caption (The text to go on the button) and the two commands
a = 0and
b = 0Whenever the user clicks the button, these commands are executed and both variables are instantly set to 0.
Screencast of construction
In the chapters that follow, you will be given more examples on how to use each of these four action tools to great effect.