A button, which can be labeled and used as desired. When creating Push Buttons, each button must have a separate value. We recommend assigning the value of 1 to your "OK" button equivalent and the value of 0 to your "Cancel" button equivalent. When the user presses a Push Button, the Dialog function will exit and will return the "value" assigned to the button which was pressed. Therefore, you should assign a unique "value" to each Push Button in a dialog. A Push Button with the value of 0, has special meaning. If the user presses a Push Button which has a value of 0, the WIL program will be terminated (or will go to the label marked ":CANCEL", if one is defined); this corresponds to the behavior of the familiar Cancel button. For more information on "Cancel", see the Windows Interface Language help file. The default Push Button, that is selected if the user presses the Enter key; is the Push Button with the focus or, if no button has the focus, the default button specified with the style bit of that control.) An ampersand in the button text, acts as an accelerator key for button navigation. For Push Buttons, "var" should be DEFAULT. The Dialog Editor adds a line to the end of your script which helps to test return values.
Buttonpushed=Dialog("MyDialog")
To test the return value do the following:
If Buttonpushed == 1 then goto label
Note: Every dialog box must contain at least one Push Button.
|
|
For example, the line in the script generated by the WIL Dialog Editor may look like:
MyDialog001=`113,252,033,011,PUSHBUTTON,"Pushbutton_OK",DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`