Introduction Appetizer Examples Documentation Applications
Work plan Controls The use of this tool is exemplified in Vectors and Euclidean Geometry. The configuration panel of CONTROLS
may have as many lines as desired. Each line defines a control and looks
like this: [4,3]'C':control=C:size=4:colour=black Controls are points that the user can drag with the mouse. The configuration of a control is a chain of expressions separated by : which
determine several properties of the control. The configuration line of a control starts with the coordinates of its initial
location in square brackets, for example [-3.2,2.5]. These
coordinates must be constant. Next comes a chain of strings, flanked by single quotes ' ,
and numbers or numerical expressions separated from each other by a + sign (see the
documentation of TEXTS for a
detailed description of this feature). Then, after a : , the expression control=C comes, where C may be
any word. C is the internal name of the control and is all
important if the control coordinates are to have any effect on the applet. The coordinates
of the control C are C.x
and C.y and they may be used in graphps, equations,
variables and functions. They may be used also as parameters, as the example Vectors shows. Another feature that may appear in the
configuration line of a control is the expression size=3
which defines the radius of the circle signaling the position of the control (in this case
the radius would be 3 pixels). An expression colour=black,
defining the colour of the border of the control's circle (in this case black) may also be
present. By default the radius is 2. All controls are red inside, only the border colour
may be chosen by the user. The default border colour is black. The following example shows a control with internal name P
whose coordinates are used as parameters. In this case, when the control is dragged, the
coordinates are actualized on the spinners. The control may also be moved by changing the
values of the coordinates of P with the spinners.
This example illustrates the use of the external name of the control
coordinates. By default these names would be P.x and P.y. The external names were defined in the example by writting name='abscissa' and name='ordinate'
in the configuration lines of the PARAMETERS P.x and P.y, respectively . A control may be restricted to move on a curve. To do this it
suffices to add the equation of the curve in the configuration line of the control. For
example, if the configuration line of the control P in the previous example is substituted
by: [P.x,P.y]'P':control=P:size=4:colour=black:x*x+y*y=25 then the control will be restricted to move on the circle of radius 5
centered at the origin. The equation defining the curve to which the control will be
restricted, is called a constriction. The example on Euclidean
Geometry uses a constriction on all the controls. Introduction Appetizer Examples Documentation Applications
Work plan
Ministerio de Educación, Cultura y Deporte. Aņo 2000