Home > SYS_MessageBox > showConfirmationMessage
SYS_MessageBox.showConfirmationMessage() method
Warning: This API is now obsolete.
Please use SYS_Dialog.showConfirmationMessage() instead
Show a confirmation box
Signature
typescript
function showConfirmationMessage(
content: string,
title?: string,
mainButtonTitle?: string,
buttonTitle?: string,
callbackFn?: (mainButtonClicked: boolean) => void,
): void;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
content | string | Message text. Line breaks can be used with |
title | string | (Optional) Confirmation box title |
mainButtonTitle | string | (Optional) Primary button title |
buttonTitle | string | (Optional) Primary button title |
callbackFn | (mainButtonClicked: boolean) => void | (Optional) Callback function. To call a function inside the extension, prefix the function name with the extension's unique ID, separated by a Western period |
Returns
void
Remarks
Show a confirmation box with confirm and cancel buttons
Example
javascript
// 1. 弹出确认窗口,等待用户点击
eda.sys_MessageBox.showConfirmationMessage(
'即将删除选中的 3 个图元,是否继续?',
'删除确认', // 窗口标题
'删除', // 主按钮(确认)
'取消', // 次按钮(取消)
(mainButtonClicked) => {
if (mainButtonClicked) {
console.log('用户点击了主按钮(删除)');
}
else {
console.log('用户点击了次按钮(取消)');
}
}
);
// 2. 窗口已弹出,本方法无返回值;回调需用户点击按钮后才会触发
console.log('已弹出确认窗口');1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18