Onetastic Macro Documentation >
>
>
DialogBox_AddButton
Adds a custom button to a dialog box.
Syntax
void DialogBox_AddButton(
DialogBox dialogBox,
String label,
String name)
Parameters
- DialogBox dialogBox
- The dialogBox to add the button to.
- String label
- A label for the button. If there is an ampersand (&) sign before a character in the label it becomes the button's accelerator key.
- String name
- Name of the button. When a dialog box is closed by clicking on this button, DialogBox_Show function will return the name of the button that was clicked.
RemarksIf no custom buttons are added to a dialog box, it will automatically have an "OK" button
when it is displayed. Up to 4 buttons can be added to a dialog box. When the user clicks
on a button the dialog box closes and DialogBox_Show function will return the name of
the button that was clicked
Examples
$dialog = DialogBox_Create("Do you want to delete this page?")
DialogBox_AddButton($dialog, "&Yes", "yes")
DialogBox_AddButton($dialog, "&No", "no")
if ("yes" == DialogBox_Show($dialog))
RemoveObject($page)
This will display the following dialog box:
After user clicks on one of the "Yes" and "No" buttons, DialogBox_Show function
returns either "yes" or "no", the name of the button user clicked.
|