The Window class gives access to windows for a graphical user interface. More...
The REPORTER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Description |
| Window.CANCEL | Show CANCEL button |
| Window.NO | Show NO button |
| Window.OK | Show OK button |
| Window.YES | Show YES button |
Detailed DescriptionThe Window class is used to define several standard windows that can be used to read data, give messages and provide feedback |
Details of functionsError(title[string], error[string], buttons (optional)[constant]) [static]DescriptionShow an error message in a window. |
Title for window.
Error message to show in window.
The buttons to use. Can be bitwise OR of Window.OK, Window.CANCEL, Window.YES or Window.NO. If this is omitted an OK button will be used.
ReturnsButton pressed Return typeNumber |
GetDirectory(initial (optional)[string]) [static]DescriptionMap the directory selector box native to your machine, allowing you to choose a directory. |
Initial directory to start from.
Returnsdirectory (string), (or null if cancel pressed). Return typeString |
ExampleTo select a directory: var dir = Window.GetDirectory();
|
GetFile(extension (optional)[string], allow new (optional)[boolean], initial (optional)[string]) [static]DescriptionMap a file selector box allowing you to choose a file. See also Window.GetFiles() |
Extension to filter by.
Allow creation of new file.
Initial directory to start from.
Returnsfilename (string), (or null if cancel pressed). Return typeString |
ExampleTo select a file using extension '.key': var file = Window.GetFile(".key");
|
GetFiles(extension (optional)[string]) [static]DescriptionMap a file selector box allowing you to choose multiple files. See also Window.GetFile() |
Extension to filter by.
ReturnsArray of filenames (strings), or null if cancel pressed. Return typeString |
ExampleTo select multiple files using extension '.key': var files = Window.GetFiles(".key");
|
GetInteger(title[string], message[string]) [static]DescriptionMap a window allowing you to input an integer. OK and Cancel buttons are shown. |
Title for window.
Message to show in window.
ReturnsInteger. Value input, (or null if cancel pressed). Return typeNumber |
ExampleTo create an input window with title Input and message Input integer and return the value input: var value = Window.GetInteger("Input", "Input integer");
|
GetNumber(title[string], message[string]) [static]DescriptionMap a window allowing you to input a number. OK and Cancel buttons are shown. |
Title for window.
Message to show in window.
ReturnsReal. Value input, (or null if cancel pressed). Return typeNumber |
ExampleTo create an input window with title Input and message Input number and return the value input: var value = Window.GetNumber("Input", "Input number");
|
GetOptions(title[string], message[string], options[object]) [static]DescriptionMap a window allowing you to input various options. OK and Cancel buttons are shown. |
Title for window.
Message to show in window.
Array of objects listing options that can be set. If OK is pressed the objects will be updated with the values from the widgets. If cancel is pressed they will not.
Object has the following properties:
| Name | Type | Description |
| selected (optional) | boolean | If checkbox is selected or not |
| text | string | Text to show next to option |
| type | string | Type of option. Can be "label" (plain text), "text" (a one line text widget), "textbox" (a multi line text widget) or "checkbox" (a checkable option) |
| value | string | Text to show for option |
Returnsfalse if cancel pressed, true if OK pressed. Return typeBoolean |
GetString(title[string], message[string]) [static]DescriptionMap a window allowing you to input a string. OK and Cancel buttons are shown. |
Title for window.
Message to show in window.
ReturnsString. Value input, (or null if cancel pressed). Return typeString |
ExampleTo create an input window with title Input and message Input string and return the value input: var value = Window.GetString("Input", "Input string");
|
Information(title[string], info[string], buttons (optional)[constant]) [static]DescriptionShow information in a window. |
Title for window.
Information to show in window.
The buttons to use. Can be bitwise OR of Window.OK, Window.CANCEL, Window.YES or Window.NO. If this is omitted an OK button will be used.
ReturnsButton pressed Return typeNumber |
Message(title[string], message[string], buttons (optional)[constant]) [static]DescriptionShow a message in a window. |
Title for window.
Message to show in window.
The buttons to use. Can be bitwise OR of Window.OK, Window.CANCEL, Window.YES or Window.NO. If this is omitted an OK button will be used
ReturnsButton pressed Return typeNumber |
Question(title[string], question[string], buttons (optional)[constant]) [static]DescriptionShow a question in a window. |
Title for window.
Question to show in window.
The buttons to use. Can be bitwise OR of Window.OK, Window.CANCEL, Window.YES or Window.NO. If this is omitted Yes and No button will be used.
ReturnsButton pressed Return typeNumber |
Warning(title[string], warning[string], buttons (optional)[constant]) [static]DescriptionShow a warning message in a window. |
Title for window.
Warning message to show in window.
The buttons to use. Can be bitwise OR of Window.OK, Window.CANCEL, Window.YES or Window.NO. If this is omitted an OK button will be used.
ReturnsButton pressed Return typeNumber |