1.1.0 • Published 3 years ago
node-win-dialog v1.1.0
node-win-dialog
Install
Warning Windows only !!!
$ npm i node-win-dialog@latest
Screenshots
Usage
const Dialog = require('node-win-dialog');
const log = new Dialog();
log.showDialog('Hello wolrd', 'title');
log.showInputBox('Hello wolrd', 'title', 'default text')
log.showOpenFileDialog(false, 'title');
log.showFolderDialog('Description');
Properties
WinTools
See WinTools
Methods
showDialog
Param | Type | Optional | Default | Description |
---|---|---|---|---|
message | ?string | ✅ | none | Message to display |
title | ?string | ✅ | none | Title of the dialog |
type | ?MessageTypeString | ✅ | DEFAULT | Type of the dialog |
button | ?ButtonString | ✅ | DEFAULT | Buttons of the dialog |
defaultButton | ?ButtonDefaultString | ✅ | DEFAULT | Default button of the dialog |
icon | ?IconString | ✅ | DEFAULT | Icon of the dialog |
showInputBox
Param | Type | Optional | Default | Description |
---|---|---|---|---|
message | ?string | ✅ | none | Message to display |
title | ?string | ✅ | none | Title of the dialog |
defaultText | ?string | ✅ | none | Default text of the input box |
xPos | ?number | ✅ | none | X position of the dialog |
yPos | ?number | ✅ | none | Y position of the dialog |
showOpenFileDialog
Param | Type | Optional | Default | Description |
---|---|---|---|---|
multiFile | ?boolean | ✅ | none | Allow multi select |
title | ?string | ✅ | Open | Title of the dialog |
...filterData | ?Array <filterData > | ✅ | none | File type filter |
showFolderDialog
Param | Type | Optional | Default | Description |
---|---|---|---|---|
description | ?string | ✅ | Please choose a folder. | Description of the dialog |
Typedefs
Response
Types
Param | Type |
---|---|
exitCode | number |
msgOut | string |
msgErr | string |
isError | boolean |
data | ?ReturnButton or string or Array [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
filterData
Types
Param | Type |
---|---|
name | string |
ext | string |
ReturnButton
OK
CANCEL
YES
NO
ABORT
RETRY
IGNORE
Types
ButtonString
OK
OK_CANCEL
YES_NO
YES_NO_CANCEL
ABORT_RETRY_IGNORE
RETRY_CANCEL
DEFAULT
Types
IconString
NONE
ERROR
WARNING
INFORMATION
QUESTION
Types
ButtonDefaultString
FIRST
SECOND
THIRD
FOURTH
DEFAULT
Types
MessageTypeString
DEFAULT
APPLICATION
SYSTEM
Types