2.0 KiB
2.0 KiB
Dialog
A dialog overlay system that provides common dialog types such as alert, confirm, and prompt.
Extends: Frame
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| title | string | "" | The dialog title |
| primaryColor | color | lime | Primary button color (OK, confirm actions) |
| secondaryColor | color | lightGray | Secondary button color (Cancel, dismiss actions) |
| buttonForeground | color | black | Foreground color for buttons |
| modal | boolean | true | If true, blocks all events outside the dialog |
Functions
| Method | Returns | Description |
|---|---|---|
| Dialog:show | Dialog | Shows the dialog |
| Dialog:close | Dialog | Closes the dialog |
| Dialog:alert | Dialog | Creates a simple alert dialog |
| Dialog:confirm | Dialog | Creates a confirm dialog |
| Dialog:prompt | Dialog | Creates a prompt dialog with input |
Dialog:show()
Shows the dialog
Returns
DialogselfThe Dialog instance
Dialog:close()
Closes the dialog
Returns
DialogselfThe Dialog instance
Dialog:alert(title, message, callback?)
Creates a simple alert dialog
Parameters
titlestringThe alert titlemessagestringThe alert messagecallback(optional)functionCallback when OK is clicked
Returns
DialogselfThe Dialog instance
Dialog:confirm(title, message, callback)
Creates a confirm dialog
Parameters
titlestringThe dialog titlemessagestringThe confirmation messagecallbackfunctionCallback (receives boolean result)
Returns
DialogselfThe Dialog instance
Dialog:prompt(title, message, default?, callback?)
Creates a prompt dialog with input
Parameters
titlestringThe dialog titlemessagestringThe prompt messagedefault(optional)stringDefault input valuecallback(optional)functionCallback (receives input text or nil if cancelled)
Returns
DialogselfThe Dialog instance