code:windows:inputdialog
Differences
This shows you the differences between two versions of the page.
| code:windows:inputdialog [2011/01/29 20:42] – created jmgr | code: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 javascript> | ||
| - | var myObject = new InputDialog(parameters); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - parameters - (object) window parameters | ||
| - | * title - (string) the window' | ||
| - | * position - ([[code: | ||
| - | * opacity - (float) the window' | ||
| - | * enabled - (boolean) the window' | ||
| - | * visible - (boolean) the window' | ||
| - | * labelText - (string) the label text | ||
| - | * okButtonText - (string) the text of the ok button | ||
| - | * cancelButtonText - (string) the text of the cancel button | ||
| - | * textEchoMode - ([[# | ||
| - | * 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 - ([[# | ||
| - | * 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 - ([[# | ||
| - | * onValueChanged - ([[# | ||
| - | |||
| - | === Exceptions === | ||
| - | * (ParameterTypeError) incorrect parameter type | ||
| - | * (ParameterCountError) incorrect parameter count | ||
| - | |||
| - | === Example === | ||
| - | <code javascript> | ||
| - | var myObject = new InputDialog(); | ||
| - | </ | ||
| - | <code javascript> | ||
| - | var myObject = new InputDialog({ | ||
| - | title: "Enter text:", | ||
| - | inputType: InputDialog.Text | ||
| - | }); | ||
| - | </ | ||
| - | |||
| - | ===== Methods ===== | ||
| - | |||
| - | ==== setTitle ==== | ||
| - | Sets the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setTitle(title); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - title - (string) the window' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setPosition ==== | ||
| - | Sets the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setPosition(point); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - point - ([[code: | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setOpacity ==== | ||
| - | Sets the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setOpacity(opacity); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - opacity - (float) the window' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setEnabled ==== | ||
| - | Sets the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setEnabled(enabled); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - enabled - (boolean) the window' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setVisible ==== | ||
| - | Sets the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setVisible(visible); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - visible - (boolean) the window' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== close ==== | ||
| - | Closes the window. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.close(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== title ==== | ||
| - | Returns the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.title(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (string) the window' | ||
| - | |||
| - | ==== position ==== | ||
| - | Returns the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.position(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * ([[code: | ||
| - | |||
| - | ==== opacity ==== | ||
| - | Returns the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.opacity(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (float) the window' | ||
| - | |||
| - | ==== enabled ==== | ||
| - | Returns the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.enabled(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (boolean) the window' | ||
| - | |||
| - | ==== visible ==== | ||
| - | Returns the window' | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.visible(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (boolean) the window' | ||
| - | |||
| - | ==== setLabelText ==== | ||
| - | Sets the label text. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setLabelText(text); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - text - (string) the label text | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setOkButtonText ==== | ||
| - | Sets the ok button text. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setLabelText(text); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - text - (string) the ok button' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setCancelButtonText ==== | ||
| - | Sets the cancel button text. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setCancelButtonText(text); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - text - (string) the cancel button' | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setTextEchoMode ==== | ||
| - | Sets the text echo mode. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setTextEchoMode(textEchoMode); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - textEchoMode - ([[# | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setFloatDecimals ==== | ||
| - | Sets the number of decimals of floating values. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setFloatDecimals(decimals); | ||
| - | </ | ||
| - | |||
| - | === 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); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - step - (integer) the integer step value | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setMaximum ==== | ||
| - | Sets the maximum value. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setMaximum(maximum); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - maximum - (mixed) the maximum value | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setMinimum ==== | ||
| - | Sets the minimum value. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setMinimum(minimum); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - minimum - (mixed) the minimum value | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setRange ==== | ||
| - | Sets the minimum and maximum values. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setRange(minimum, | ||
| - | </ | ||
| - | |||
| - | === 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); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - inputType - ([[# | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setValue ==== | ||
| - | Sets the value. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setValue(value); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - value - (mixed) the value | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== setItems ==== | ||
| - | Sets the items that can be choosen from. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.setItems(items); | ||
| - | </ | ||
| - | |||
| - | === 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); | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - itemsEditable - (boolean) should the item list be editable | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== value ==== | ||
| - | Returns the value. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.value(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (mixed) the value | ||
| - | |||
| - | ==== show ==== | ||
| - | Show the window. (non-blocking) | ||
| - | Use the [[# | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.show(); | ||
| - | </ | ||
| - | |||
| - | === Returns === | ||
| - | * (InputDialog) this InputDialog | ||
| - | |||
| - | ==== showModal ==== | ||
| - | Show the window. (blocking) | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.showModal(); | ||
| - | </ | ||
| - | |||
| - | === 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) {}; | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - result - (integer) the window result (0 means that it has been canceled) | ||
| - | |||
| - | === Example === | ||
| - | <code javascript> | ||
| - | myObject.onClosed = function(result) | ||
| - | { | ||
| - | if(result) | ||
| - | { | ||
| - | //Event action | ||
| - | } | ||
| - | }; | ||
| - | </ | ||
| - | |||
| - | ==== onValueChanged ==== | ||
| - | Called when the value changes. | ||
| - | |||
| - | === Syntax === | ||
| - | <code javascript> | ||
| - | myObject.onValueChanged = function(value) {}; | ||
| - | </ | ||
| - | |||
| - | === Arguments === | ||
| - | - value - (mixed) the current value | ||
| - | |||
| - | === Example === | ||
| - | <code javascript> | ||
| - | myObject.onValueChanged = function(value) | ||
| - | { | ||
| - | //Event action | ||
| - | }; | ||
| - | </ | ||
| - | |||
| - | ===== Attributes ===== | ||
| - | |||
| - | ==== title ==== | ||
| - | The window' | ||
| - | |||
| - | ==== position ==== | ||
| - | The window' | ||
| - | |||
| - | ==== opacity ==== | ||
| - | The window' | ||
| - | |||
| - | ==== enabled ==== | ||
| - | The window' | ||
| - | |||
| - | ==== visible ==== | ||
| - | The window' | ||
| - | |||
| - | ==== value ==== | ||
| - | The window' | ||
| - | |||
| - | ===== 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: | ||
code/windows/inputdialog.1296333732.txt.gz · Last modified: (external edit)
