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

来自GeoGebra Manual
跳转至: 导航搜索
 
(未显示2个用户的8个中间版本)
第1行: 第1行:
<noinclude>{{Manual Page|version=4.0}}</noinclude>{{objects}}
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{objects}}
For interactive worksheets with [[Scripting|scripting]] Action Objects may come handy. There are four types of them
+
在製作帶有[[ 編寫程式| 程式]] 功能的互動式學習單時,'''動作物件'''(Action Object)可能會派上用場。<br>
==Checkboxes==
+
動作物件有四種類型:
Checkboxes are graphical representations of [[Boolean values]]. See [[Check Box to Show / Hide Objects Tool]] for details.
+
== 勾選框==
Checkboxes can be created using the aforementioned tool or [[Checkbox Command]].
+
'''勾選框'''為'''[[ 真假值]]'''的圖像表徵,可以使用 [[File:Mode showcheckbox.svg|link=|22px]] '''[[ 勾選框_工具|勾選框]] 工具'''或 [[Checkbox_指令]] 來建立。
==Input Boxes==
+
 
 +
== 輸入欄位==
 
Input Boxes work as text inputs for [[Scripting|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 Boxes work as text inputs for [[Scripting|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.
 
{{example|1=Input Box with <code>a=a+%0</code> in script will increase number ''a'' by the entered value. Works only if ''a'' is [[Free, Dependent and Auxiliary Objects|free]].}}
 
{{example|1=Input Box with <code>a=a+%0</code> in script will increase number ''a'' by the entered value. Works only if ''a'' is [[Free, Dependent and Auxiliary Objects|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.
+
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.<br>
Input Boxes can be created using [[Insert Input Box Tool]] or [[InputBox Command]].
+
Input Boxes can be created using the [[File:Mode textfieldaction.svg|link=|22px]] [[Input Box Tool]] or the [[InputBox Command]].
==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.
+
== 按鈕==
Input Boxes can be created using [[Insert Button Tool]] or [[Button Command]].
+
'''按鈕'''(button)是為了通過點按動作來觸發程式腳本。雖然透過點按其他物件(例如:一張[[ 插入圖片_工具| 圖片]] )也能觸發程式腳本,但使用按鈕能讓您的學習單更直觀。<br>
 +
按鈕可以使用 [[File:Mode buttonaction.svg|link=|22px]] '''[[ 按鈕_工具] 按鈕] 工具'''或 [[Button_指令]] 來建立。
 +
 
 
==下拉式選單==
 
==下拉式選單==
 下拉式選單的 功能只有[[試算表]]中 才有。你 可以在儲存格中輸入一個集合(如:A1={1,2,3,4}),然後打開[[ 屬性對話視窗|試算表選項]],並勾選「使用按鈕與勾選框」,這時儲存格就會變為一個下拉式選單。 如果在程式中要使用目前 拉式選單所選擇 項目,可以使用 [[SelectedIndex 指令|SelectedIndex]] 與 [[SelectedElement 指令|SelectedElement]] 兩個指令。
+
  若您想要顯示某個串列的內容,可以整合至''' 下拉式選單'''(drop-down list):
 +
* 在 [[File:Menu view graphics.svg|link=|16px]] '''[[繪圖區]]'''中顯示:開啟串列 [[File:Menu-options.svg|link=|18px]] '''[[屬性]]對話窗''',在'''一般'''分頁勾選「顯示為下拉式選單」。
 +
* 在 [[File:Menu view spreadsheet.svg|link=|16px]] '''[[試算表]]''' 顯示:您 可以在儲存格中輸入一個集合(如:A1={1,2,3,4}),然後打開 [[File:Menu view spreadsheet.svg|link=|16px]] '''[[設定|試算表選項]]''' ,並勾選「使用按鈕與勾選框」,這時儲存格就會變為一個下拉式選單。{{note|請看以 下的 影片說明(沒有錄音):
 +
[[File:YoutubeCombobox.png|link=http://www.youtube.com/watch?v=AzCOVnMjEb0]]}}
  
  請看以 下的 影片說明(沒有錄音):
+
  如果在程式中要使用目前 拉式選單所選擇 項目,可以使用 [[SelectedIndex_指令|SelectedIndex]] 與 [[SelectedElement_指令|SelectedElement]] 兩個指令。
  
[[File:YoutubeCombobox.png|link=http://www.screenr.com/cPRs]]
+
{{example| 要建立一個包含三個函數 <code>x+1</code>、<code>x^2</code>、<code>sqrt(x)</code>的下拉式選單,首先在指令列輸入 <code>L={x+1, x^2,sqrt(x)}</code> 建立一個串列。然後在'''代數區'''的串列按滑鼠右鍵並點選'''屬性'''。在跳出的對話窗中勾選「顯示為下拉式選單」。您也可以幫下拉式選單加上標籤文字。若要在'''繪圖區'''畫上目前選擇的函數圖形,可到指令列輸入:<code>SelectedElement(L)</code>。}}
[[Category:Awaiting Translation]]
 

2021年6月15日 (二) 03:34的最新版本

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


在製作帶有程式功能的互動式學習單時,動作物件(Action Object)可能會派上用場。
動作物件有四種類型:

勾選框

勾選框真假值的圖像表徵,可以使用 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 list):

  • Menu view graphics.svg 繪圖區中顯示:開啟串列的 Menu-options.svg 屬性對話窗,在一般分頁勾選「顯示為下拉式選單」。
  • Menu view spreadsheet.svg 試算表中顯示:您可以在儲存格中輸入一個集合(如:A1={1,2,3,4}),然後打開 Menu view spreadsheet.svg 試算表選項,並勾選「使用按鈕與勾選框」,這時儲存格就會變為一個下拉式選單。
    備註: 請看以下的影片說明(沒有錄音):

YoutubeCombobox.png

如果在程式中要使用目前下拉式選單所選擇的項目,可以使用 SelectedIndexSelectedElement 兩個指令。

範例: 要建立一個包含三個函數 x+1x^2sqrt(x)的下拉式選單,首先在指令列輸入 L={x+1, x^2,sqrt(x)} 建立一個串列。然後在代數區的串列按滑鼠右鍵並點選屬性。在跳出的對話窗中勾選「顯示為下拉式選單」。您也可以幫下拉式選單加上標籤文字。若要在繪圖區畫上目前選擇的函數圖形,可到指令列輸入:SelectedElement(L)
© 2024 International GeoGebra Institute