Element representing the document. This is an extension of the Document class and adds theming as well as some modal standard dialogs.
The document is accessible anywhere from within its subtree by the thisDocument
property.
The current theme is accessed by the theme property. The theme may be changed
at run-time.
The shortcut receiver is a component for receiving keyboard shortcuts. By default,
the document is the shortcut receiver. Sub-elements, however, may redefine the
shortcutReceiver property for handling keyboard shortcuts. This way, different
scopes of keyboard shortcuts can be implemented and even nested.
Keyboard shortcuts may be defined by any component by connecting to the keyDown
event of the effective shortcut receiver, accessed by the shortcutReceiver reference.
Box {
shortcutReceiver.onKeyDown: ev =>
{
// handle the shortcuts...
}
}
Properties:
| Name | Type | Description |
|---|---|---|
documentRoot |
ui.Document | [readonly] Deprecated: Use |
shortcutReceiver |
ui.Document | [readonly] A reference to this document for functioning as a receiver of keyboard shortcuts. |
theme |
ui.Theme | (default: |
Extends
Methods
-
showErrorDialog (title, message, callback)ui.Dialog
-
Shows a modal error message dialog.
Name Type Description titlestring The title of the dialog.
messagestring The message text of the dialog.
callbackfunction The callback that is invoked when the user closes the dialog.
Returns:
Type Description ui.Dialog The dialog instance. -
showInfoDialog (title, message, callback)ui.Dialog
-
Shows a modal info message dialog.
Name Type Description titlestring The title of the dialog.
messagestring The message text of the dialog.
callbackfunction The callback that is invoked when the user closes the dialog.
Returns:
Type Description ui.Dialog The dialog instance. -
showMessageDialog (title, icon, message, buttons)ui.Dialog
-
Shows a generic modal message dialog.
Name Type Description titlestring The title of the dialog.
iconstring The name of the icon on the dialog.
messagestring The message text of the dialog.
buttonsArray.<object> The dialog buttons. Each item in the list is a
{ label, callback }object.Returns:
Type Description ui.Dialog The dialog instance. Example
showMessageDialog("Error opening file", "core-bug", "The file could not be opened.", [ { label: "Retry", callback: retryCallback }, { label: "Cancel", callback: cancelCallback } ]); -
showProgressDialog (title, message)ui.Dialog
-
Shows a modal progress dialog.
The returned dialog instance has a property
progressfor changing the progress value (a value between 0.0 and 1.0), and a propertymessagefor changing the current message text.Name Type Description titlestring The title of the dialog.
messagestring The message text of the dialog.
Returns:
Type Description ui.Dialog The dialog instance. -
showQuestionDialog (title, message, yesCallback, noCallback)ui.Dialog
-
Shows a modal question dialog with buttons for answering "Yes" or "No".
Name Type Description titlestring The title of the dialog.
messagestring The message text of the dialog.
yesCallbackfunction The callback that is invoked when the user chooses "Yes".
noCallbackfunction The callback that is invoked when the user chooses "No".
Returns:
Type Description ui.Dialog The dialog instance. -
showWarningDialog (title, message, callback)ui.Dialog
-
Shows a modal warning message dialog.
Name Type Description titlestring The title of the dialog.
messagestring The message text of the dialog.
callbackfunction The callback that is invoked when the user closes the dialog.
Returns:
Type Description ui.Dialog The dialog instance.