“動作物件”的版本间的差异

来自GeoGebra Manual
跳转至: 导航搜索
第12行: 第12行:
  
 
==按鈕==
 
==按鈕==
按鈕(button)是為了通過點按動作來觸發程式腳本。雖然透過點按其他物件(例如:一張[[插入圖片_工具|圖片]])也能觸發程式腳本,但使用按鈕能讓您的學習單更直觀。<br>
+
''' 按鈕''' (button)是為了通過點按動作來觸發程式腳本。雖然透過點按其他物件(例如:一張[[插入圖片_工具|圖片]])也能觸發程式腳本,但使用按鈕能讓您的學習單更直觀。<br>
 按鈕可以 用 [[File:Mode buttonaction.svg|link=|22px]] '''[[按鈕_工具]按鈕]工具'''或 [[Button_指令]]來建立。
+
 按鈕可以 使 用 [[File:Mode buttonaction.svg|link=|22px]] '''[[按鈕_工具]按鈕]工具'''或 [[Button_指令]]來建立。
  
 
==Drop-down lists==
 
==Drop-down lists==

2021年6月15日 (二) 02:54的版本

Accessories dictionary.png
本頁為官方文件,一般使用者無法修改,若有任何誤謬,請與官方聯絡。如欲編輯,請至本頁的開放版


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

勾選框

勾選框真假值的圖像表徵,可以使用 Mode showcheckbox.svg 勾選框工具Checkbox_指令來建立。

輸入欄位

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

範例: Input Box with a=a+%0 in script will increase number a by the entered value. Works only if a is free.

If you want the Input Box 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.
Input Boxes can be created using the Mode textfieldaction.svg Input Box Tool or the InputBox Command.

按鈕

按鈕(button)是為了通過點按動作來觸發程式腳本。雖然透過點按其他物件(例如:一張圖片)也能觸發程式腳本,但使用按鈕能讓您的學習單更直觀。
按鈕可以使用 Mode buttonaction.svg [[按鈕_工具]按鈕]工具Button_指令來建立。

Drop-down lists

If you want to show the contents of a list, organized in a drop-down list:

  • in the Menu view graphics.svg Graphics View: check the Draw as drop-down list box in the Basics tab of the Menu-options.svg Properties Dialog of the list.
  • in the Menu view spreadsheet.svg Spreadsheet View: enter a list into the spreadsheet, then check the Use Buttons and Checkboxes box in the Menu view spreadsheet.svg Spreadsheet Options.

The selected element of a drop-down list may be also obtained using SelectedIndex and SelectedElement commands.

範例: To create a drop-down list with three functions x+1, x^2, sqrt(x), first create a list by typing L={x+1, x^2,sqrt(x)} in the input bar. Then right-click the list in Algebra View and select Object Properties.... Select the Draw as drop-down list option in the appearing dialog window. You can also enter a caption that describes the drop-down list. In order to plot in Graphics View the currently selected function, enter the command SelectedElement(L) in the input bar .

下拉式選單

下拉式選單的功能只有試算表中才有。你可以在儲存格中輸入一個集合(如:A1={1,2,3,4}),然後打開試算表選項,並勾選「使用按鈕與勾選框」,這時儲存格就會變為一個下拉式選單。如果在程式中要使用目前下拉式選單所選擇的項目,可以使用 SelectedIndexSelectedElement 兩個指令。

請看以下的影片說明(沒有錄音):

YoutubeCombobox.png

© 2024 International GeoGebra Institute