Table des matières

InputDialog

This object represents a window asking the user to enter data.

Functions

InputDialog

Constructor function.

Syntax

var myObject = new InputDialog();
var myObject = new InputDialog(parameters);

Arguments

  1. parameters - (object) window parameters
    • title - (string) the window's title
    • position - (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) 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) 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) event called when the window is closed
    • onValueChanged - (OnValueChanged) event called when the value changes

Exceptions

Example

var myObject = new InputDialog();
var myObject = new InputDialog({
	title: "Enter text:",
	inputType: InputDialog.Text
});

Methods

setTitle

Sets the window's title.

Syntax

myObject.setTitle(title);

Arguments

  1. title - (string) the window's title

Returns

setPosition

Sets the window's position.

Syntax

myObject.setPosition(point);

Arguments

  1. point - (Point) the window's position

Returns

setOpacity

Sets the window's opacity.

Syntax

myObject.setOpacity(opacity);

Arguments

  1. opacity - (float) the window's opacity

Returns

setEnabled

Sets the window's enabled status.

Syntax

myObject.setEnabled(enabled);

Arguments

  1. enabled - (boolean) the window's enabled status

Returns

setVisible

Sets the window's visible status.

Syntax

myObject.setVisible(visible);

Arguments

  1. visible - (boolean) the window's visible status

Returns

close

Closes the window.

Syntax

myObject.close();

Returns

title

Returns the window's title.

Syntax

myObject.title();

Returns

position

Returns the window's position.

Syntax

myObject.position();

Returns

opacity

Returns the window's opacity.

Syntax

myObject.opacity();

Returns

enabled

Returns the window's enabled status.

Syntax

myObject.enabled();

Returns

visible

Returns the window's visible status.

Syntax

myObject.visible();

Returns

setLabelText

Sets the label text.

Syntax

myObject.setLabelText(text);

Arguments

  1. text - (string) the label text

Returns

setOkButtonText

Sets the ok button text.

Syntax

myObject.setLabelText(text);

Arguments

  1. text - (string) the ok button's label

Returns

setCancelButtonText

Sets the cancel button text.

Syntax

myObject.setCancelButtonText(text);

Arguments

  1. text - (string) the cancel button's label

Returns

setTextEchoMode

Sets the text echo mode.

Syntax

myObject.setTextEchoMode(textEchoMode);

Arguments

  1. textEchoMode - (TextEchoMode) the text echo mode

Returns

setFloatDecimals

Sets the number of decimals of floating values.

Syntax

myObject.setFloatDecimals(decimals);

Arguments

  1. decimals - (integer) the number of decimals of floating values

Returns

setIntegerStep

Sets the integer step value.

Syntax

myObject.setIntegerStep(step);

Arguments

  1. step - (integer) the integer step value

Returns

setMaximum

Sets the maximum value.

Syntax

myObject.setMaximum(maximum);

Arguments

  1. maximum - (mixed) the maximum value

Returns

setMinimum

Sets the minimum value.

Syntax

myObject.setMinimum(minimum);

Arguments

  1. minimum - (mixed) the minimum value

Returns

setRange

Sets the minimum and maximum values.

Syntax

myObject.setRange(minimum, maximum);

Arguments

  1. minimum - (mixed) the minimum value
  2. maximum - (mixed) the maximum value

Returns

setInputType

Sets the input type.

Syntax

myObject.setRange(inputType);

Arguments

  1. inputType - (InputType) the input type

Returns

setValue

Sets the value.

Syntax

myObject.setValue(value);

Arguments

  1. value - (mixed) the value

Returns

setItems

Sets the items that can be choosen from.

Syntax

myObject.setItems(items);

Arguments

  1. items - (array) the items that can be choosen from

Returns

setItemsEditable

Sets the items as editable.

Syntax

myObject.setItemsEditable(itemsEditable);

Arguments

  1. itemsEditable - (boolean) should the item list be editable

Returns

value

Returns the value.

Syntax

myObject.value();

Returns

show

Show the window. (non-blocking) Use the OnClosed event to know when the window has been closed.

Syntax

myObject.show();

Returns

showModal

Show the window. (blocking)

Syntax

myObject.showModal();

Returns

Events

onClosed

Called when the window is closed.

Syntax

myObject.onClosed = function(result) {};

Arguments

  1. result - (integer) the window result (0 means that it has been canceled)

Example

myObject.onClosed = function(result)
{
	if(result)
	{
		//Event action
	}
};

onValueChanged

Called when the value changes.

Syntax

myObject.onValueChanged = function(value) {};

Arguments

  1. value - (mixed) the current value

Example

myObject.onValueChanged = function(value)
{
	//Event action
};

Attributes

title

The window's title. (string)

position

The window's position. (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

TextEchoMode

The text echo mode.

Values