Difference between revisions of "Action Objects"

From GeoGebra Manual
Jump to: navigation, search
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>
 
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>
 
{{objects}}
 
{{objects}}
For interactive worksheets Action Objects may come handy. There are four types of them
+
For interactive worksheets with [[Scripting|scripting]] Action Objects may come handy. There are four types of them
 
==Checkboxes==
 
==Checkboxes==
 
Checkboxes are graphical representations of [[Boolean values]]. See [[Check Box to Show / Hide Objects Tool]] for details.
 
Checkboxes are graphical representations of [[Boolean values]]. See [[Check Box to Show / Hide Objects Tool]] for details.
 
==Text fields==
 
==Text fields==
 
Textfields work as text inputs for [[Scripting|scripts]]. The script is triggered by changing text in the textfield and either pressing enter or leaving the textfield. The inserted value may be accessed using the %0 variable.
 
Textfields work as text inputs for [[Scripting|scripts]]. The script is triggered by changing text in the textfield and either pressing enter or leaving the textfield. The inserted value may be accessed using the %0 variable.
{{example|Textfield with <code>a=a+%0</code> in script will increase number ''a'' by the entered value.}}
+
{{example|1=Textfield with <code>a=a+%0</code> in script will increase number ''a'' by the entered value.}}
 
If you want the textfield to change value of a free object (or redefine dependent object), you may define that object as linked. This way you don't have to insert any script.
 
If you want the textfield to change value of a free object (or redefine dependent object), you may define that object as linked. This way you don't have to insert any script.
 
==Buttons==
 
==Buttons==
 +
Buttons are meant to trigger scripts by being clicked. Although scripts can be triggered by clicking any other object (e.g. an [[Insert Image Tool|image]], using buttons for this makes your worksheet more intuitive.
 
==Comboboxes==
 
==Comboboxes==
 
Comboboxes are available only in [[Spreadsheet View]]. You may enter a list into spreadsheet cell and then turn on option ''Use Buttons and Checkboxes'' in Spreadsheet Tab of [[Options Dialog]]. The list will turn into a combobox; the selected element may be obtained using [[SelectedIndex Command]] and [[SelectedElement Command]].
 
Comboboxes are available only in [[Spreadsheet View]]. You may enter a list into spreadsheet cell and then turn on option ''Use Buttons and Checkboxes'' in Spreadsheet Tab of [[Options Dialog]]. The list will turn into a combobox; the selected element may be obtained using [[SelectedIndex Command]] and [[SelectedElement Command]].

Revision as of 23:29, 26 May 2011


For interactive worksheets with scripting Action Objects may come handy. There are four types of them

Checkboxes

Checkboxes are graphical representations of Boolean values. See Check Box to Show / Hide Objects Tool for details.

Text fields

Textfields work as text inputs for scripts. The script is triggered by changing text in the textfield and either pressing enter or leaving the textfield. The inserted value may be accessed using the %0 variable.

Example: Textfield with a=a+%0 in script will increase number a by the entered value.

If you want the textfield to change value of a free object (or redefine dependent object), you may define that object as linked. This way you don't have to insert any script.

Buttons

Buttons are meant to trigger scripts by being clicked. Although scripts can be triggered by clicking any other object (e.g. an image, using buttons for this makes your worksheet more intuitive.

Comboboxes

Comboboxes are available only in Spreadsheet View. You may enter a list into spreadsheet cell and then turn on option Use Buttons and Checkboxes in Spreadsheet Tab of Options Dialog. The list will turn into a combobox; the selected element may be obtained using SelectedIndex Command and SelectedElement Command.

© 2024 International GeoGebra Institute