new DialogController(config)
Controls the display of registered dialogs.
Only 1 dialog registered with this dialog controller will be open at a given time.
Only 1 dialog registered with this dialog controller will be open at a given time.
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration for this object. The config supplied directly extends the control |
Members
dialogs
Properties:
Name | Type | Description |
---|---|---|
dialogs |
Array.<Cadcorp.UI.DialogBase> | Array of dialogs registered with this controller |
events
Properties:
Name | Type | Description |
---|---|---|
events |
Cadcorp.Util.Events | events object. |
id
Properties:
Name | Type | Description |
---|---|---|
id |
string | The id for this control |
menuId
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
menuId |
string |
<nullable> |
The id of the menu control |
Methods
addDialog(dialog)
Registers a new dialog with this controller.
Parameters:
Name | Type | Description |
---|---|---|
dialog |
Cadcorp.UI.DialogBase | The new dialog to register |
getCurrentDialog() → {Cadcorp.UI.DialogBase|null}
Gets the current open dialog.
Returns:
The current open dialog or null.
- Type
- Cadcorp.UI.DialogBase | null
getDialog(dialogId) → {Cadcorp.UI.DialogBase}
Gets a dialog from the registered dialogs.
Parameters:
Name | Type | Description |
---|---|---|
dialogId |
string | The id of the dialog to get |
Returns:
The found dialog
hideCurrentDialog()
Hides the current open dialog.
hideDialog(dialogID)
Hides a dialog.
Parameters:
Name | Type | Description |
---|---|---|
dialogID |
string | The id of the dialog to hide |
removeDialog(dialog)
Removes a dialog from this controller.
Parameters:
Name | Type | Description |
---|---|---|
dialog |
Cadcorp.UI.DialogBase | The dialog to remove |
showDialog(dialogID)
Shows a dialog. If another dialog is already open it is closed
Parameters:
Name | Type | Description |
---|---|---|
dialogID |
string | The id of the dialog to show |