Add support for checkbox with dialog.showMessageBox

This adds the `checkboxLabel` and `checkboxChecked` options to display a
checkbox in the message box. Fixes #6048.
This commit is contained in:
Birunthan Mohanathas 2017-02-06 15:35:36 +00:00 committed by Kevin Sawicki
parent 9163b601a4
commit c8c11e68c6
10 changed files with 155 additions and 61 deletions

View file

@ -122,6 +122,11 @@ will be passed via `callback(filename)`
* `title` String (optional) - Title of the message box, some platforms will not show it.
* `message` String - Content of the message box.
* `detail` String (optional) - Extra information of the message.
* `checkboxLabel` String (optional) - If provided, the message box will
include a checkbox with the given label. The checkbox state can be
inspected only when using `callback`.
* `checkboxChecked` Boolean (optional) - Initial checked state of the
checkbox. `false` by default.
* `icon` [NativeImage](native-image.md) (optional)
* `cancelId` Integer (optional) - The value will be returned when user cancels the dialog
instead of clicking the buttons of the dialog. By default it is the index
@ -135,6 +140,8 @@ will be passed via `callback(filename)`
set `noLink` to `true`.
* `callback` Function (optional)
* `response` Number - The index of the button that was clicked
* `checkboxChecked` Boolean - The checked state of the checkbox if
`checkboxLabel` was set. Otherwise `false`.
Returns `Integer`, the index of the clicked button, if a callback is provided
it returns undefined.