User Tools

Site Tools


code:windows:inputdialog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

code:windows:inputdialog [2011/01/29 20:42] – created jmgrcode:windows:inputdialog [2011/04/20 20:32] (current) – removed jmgr
Line 1: Line 1:
-====== InputDialog ====== 
-This object represents a window asking the user to enter data. 
  
-===== Functions ===== 
- 
-==== InputDialog ==== 
-Constructor function. 
- 
-=== Syntax === 
-<code javascript> 
-var myObject = new InputDialog(); 
-</code> 
-<code javascript> 
-var myObject = new InputDialog(parameters); 
-</code> 
- 
-=== Arguments === 
-  - parameters - (object) window parameters 
-    * title - (string) the window's title 
-    * position - ([[code:core:point|Point]]) the window's position 
-    * opacity - (float) the window's opacity 
-    * enabled - (boolean) the window's enabled status 
-    * visible - (boolean) the window's visible status 
-    * labelText - (string) the label text 
-    * okButtonText - (string) the text of the ok button 
-    * cancelButtonText - (string) the text of the cancel button 
-    * textEchoMode - ([[#textechomode|TextEchoMode]]) the text echo mode 
-    * floatDecimals - (integer) the number of decimals 
-    * integerStep - (integer) the integer step 
-    * minimum - (mixed) the minimum value 
-    * maximum - (mixed) the maximum value 
-    * range - (object) the range 
-      * minimum - (mixed) the minimum value 
-      * maximum - (mixed) the maximum value 
-    * inputType - ([[#inputtype|InputType]]) the input type 
-    * value - (mixed) the default value 
-    * items - (array) the items (used when asking an item from a list) 
-    * itemsEditable - (boolean) are the items from the list editable 
-    * onClosed - ([[#onclosed|OnClosed]]) event called when the window is closed 
-    * onValueChanged - ([[#onvaluechanged|OnValueChanged]]) event called when the value changes 
- 
-=== Exceptions === 
-  * (ParameterTypeError) incorrect parameter type 
-  * (ParameterCountError) incorrect parameter count 
- 
-=== Example === 
-<code javascript> 
-var myObject = new InputDialog(); 
-</code> 
-<code javascript> 
-var myObject = new InputDialog({ 
- title: "Enter text:", 
- inputType: InputDialog.Text 
-}); 
-</code> 
- 
-===== Methods ===== 
- 
-==== setTitle ==== 
-Sets the window's title. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setTitle(title); 
-</code> 
- 
-=== Arguments === 
-  - title - (string) the window's title 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setPosition ==== 
-Sets the window's position. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setPosition(point); 
-</code> 
- 
-=== Arguments === 
-  - point - ([[code:core:point|Point]]) the window's position 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setOpacity ==== 
-Sets the window's opacity. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setOpacity(opacity); 
-</code> 
- 
-=== Arguments === 
-  - opacity - (float) the window's opacity 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setEnabled ==== 
-Sets the window's enabled status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setEnabled(enabled); 
-</code> 
- 
-=== Arguments === 
-  - enabled - (boolean) the window's enabled status 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setVisible ==== 
-Sets the window's visible status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setVisible(visible); 
-</code> 
- 
-=== Arguments === 
-  - visible - (boolean) the window's visible status 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== close ==== 
-Closes the window. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.close(); 
-</code> 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== title ==== 
-Returns the window's title. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.title(); 
-</code> 
- 
-=== Returns === 
-  * (string) the window's title 
- 
-==== position ==== 
-Returns the window's position. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.position(); 
-</code> 
- 
-=== Returns === 
-  * ([[code:core:point|Point]]) the window's position 
- 
-==== opacity ==== 
-Returns the window's opacity. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.opacity(); 
-</code> 
- 
-=== Returns === 
-  * (float) the window's opacity 
- 
-==== enabled ==== 
-Returns the window's enabled status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.enabled(); 
-</code> 
- 
-=== Returns === 
-  * (boolean) the window's enabled status 
- 
-==== visible ==== 
-Returns the window's visible status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.visible(); 
-</code> 
- 
-=== Returns === 
-  * (boolean) the window's visible status 
- 
-==== setLabelText ==== 
-Sets the label text. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setLabelText(text); 
-</code> 
- 
-=== Arguments === 
-  - text - (string) the label text 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setOkButtonText ==== 
-Sets the ok button text. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setLabelText(text); 
-</code> 
- 
-=== Arguments === 
-  - text - (string) the ok button's label 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setCancelButtonText ==== 
-Sets the cancel button text. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setCancelButtonText(text); 
-</code> 
- 
-=== Arguments === 
-  - text - (string) the cancel button's label 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setTextEchoMode ==== 
-Sets the text echo mode. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setTextEchoMode(textEchoMode); 
-</code> 
- 
-=== Arguments === 
-  - textEchoMode - ([[#textechomode|TextEchoMode]]) the text echo mode 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setFloatDecimals ==== 
-Sets the number of decimals of floating values. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setFloatDecimals(decimals); 
-</code> 
- 
-=== Arguments === 
-  - decimals - (integer) the number of decimals of floating values 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setIntegerStep ==== 
-Sets the integer step value. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setIntegerStep(step); 
-</code> 
- 
-=== Arguments === 
-  - step - (integer) the integer step value 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setMaximum ==== 
-Sets the maximum value. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setMaximum(maximum); 
-</code> 
- 
-=== Arguments === 
-  - maximum - (mixed) the maximum value 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setMinimum ==== 
-Sets the minimum value. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setMinimum(minimum); 
-</code> 
- 
-=== Arguments === 
-  - minimum - (mixed) the minimum value 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setRange ==== 
-Sets the minimum and maximum values. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setRange(minimum, maximum); 
-</code> 
- 
-=== Arguments === 
-  - minimum - (mixed) the minimum value 
-  - maximum - (mixed) the maximum value 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setInputType ==== 
-Sets the input type. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setRange(inputType); 
-</code> 
- 
-=== Arguments === 
-  - inputType - ([[#inputtype|InputType]]) the input type 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setValue ==== 
-Sets the value. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setValue(value); 
-</code> 
- 
-=== Arguments === 
-  - value - (mixed) the value 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setItems ==== 
-Sets the items that can be choosen from. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setItems(items); 
-</code> 
- 
-=== Arguments === 
-  - items - (array) the items that can be choosen from 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== setItemsEditable ==== 
-Sets the items as editable. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setItemsEditable(itemsEditable); 
-</code> 
- 
-=== Arguments === 
-  - itemsEditable - (boolean) should the item list be editable 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== value ==== 
-Returns the value. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.value(); 
-</code> 
- 
-=== Returns === 
-  * (mixed) the value 
- 
-==== show ==== 
-Show the window. (non-blocking) 
-Use the [[#onclosed|OnClosed]] event to know when the window has been closed. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.show(); 
-</code> 
- 
-=== Returns === 
-  * (InputDialog) this InputDialog 
- 
-==== showModal ==== 
-Show the window. (blocking) 
- 
-=== Syntax === 
-<code javascript> 
-myObject.showModal(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the window result (0 means that it has been canceled) 
- 
-===== Events ===== 
- 
-==== onClosed ==== 
-Called when the window is closed. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.onClosed = function(result) {}; 
-</code> 
- 
-=== Arguments === 
-  - result - (integer) the window result (0 means that it has been canceled) 
- 
-=== Example === 
-<code javascript> 
-myObject.onClosed = function(result) 
-{ 
- if(result) 
- { 
- //Event action 
- } 
-}; 
-</code> 
- 
-==== onValueChanged ==== 
-Called when the value changes. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.onValueChanged = function(value) {}; 
-</code> 
- 
-=== Arguments === 
-  - value - (mixed) the current value 
- 
-=== Example === 
-<code javascript> 
-myObject.onValueChanged = function(value) 
-{ 
- //Event action 
-}; 
-</code> 
- 
-===== Attributes ===== 
- 
-==== title ==== 
-The window's title. (string) 
- 
-==== position ==== 
-The window's position. ([[code:core:point|Point]]) 
- 
-==== opacity ==== 
-The window's opacity. (float) 
- 
-==== enabled ==== 
-The window's enabled status. (boolean) 
- 
-==== visible ==== 
-The window's visible status. (boolean) 
- 
-==== value ==== 
-The window's value. (mixed) 
- 
-===== Enumerations ===== 
- 
-==== InputType ==== 
-The input type. 
- 
-=== Values === 
-  - Text: text 
-  - Integer: an integer 
-  - Float: a floating number (decimal) 
-  - Items: a list of items 
- 
-==== TextEchoMode ==== 
-The text echo mode. 
- 
-=== Values === 
-  - Normal: normal text display 
-  - NoEcho: do not show the text 
-  - Password: show password characters instead of the typed characters 
-  - PasswordEchoOnEdit: show password characters instead of the typed characters only when editing 
code/windows/inputdialog.1296333732.txt.gz · Last modified: 2021/02/13 11:23 (external edit)