Responding to Cancellation of a User Dialog Box

DIAdem 2018 Help


Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)


DIAdem 2015 Help
DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help

Use the DlgState variable to react to the cancellation of a dialog box during a script. Complete the following steps to display a message that indicates which status the dialog box was closed in:

  1. Select the DIAdem SCRIPT panel.

  2. Select Edit»Create Dialog Box.

  3. Click the Button control on the Controls bar. 

  4. Drag open the control in the dialog box.

  5. Click the column to the right of the ButtonType field in the Properties tab and select 4-OK. Button1 must be selected.

  6. Click the column to the right of the Text field in the Properties tab and enter OK. Button1 must be selected.

  7. Click the Button control on the Controls bar. 

  8. Drag open the control in the dialog box.

  9. Click the column to the right of the ButtonType field in the Properties tab and enter 0–Cancel. Button2 must be selected.

  10. Click the column to the right of the Text field in the Properties tab and enter Cancel. Button2 must be selected.

  11. Select File»Save As and save the file as Test.sud.

  12. Close the dialog editor and switch to DIAdem.

  13. Select File»New»VBS Script to create a new script.

  14. Enter or copy the following text into the script editor:

    Call SUDDlgShow("Dlg1","Test.sud")     ' display dialog box
    If DlgState = "IDOk" Then
      Call MsgBoxDisp("<OK> selected")
    Else
      Call MsgBoxDisp("<Cancel> selected")
    End If
  15. Select Script»Run VBS Script to start the script.

  16. Close the user dialog box with OK or Cancel.

The script uses the DlgState variable to determine which button you clicked to close the user dialog box and informs you in a message whether you selected OK or Cancel.

  1. Close the dialog editor.

Examples

Analyzing and Displaying Channels Section by Section | Checking Dialog Box Entries | Dynamic User Dialog Box | Translating User Dialog Boxes | User Dialog Box for Entering Text and Numbers | User Dialog Box for Sequence Control | User Dialog Box in DIAdem VIEW | User Dialog Box in VIEW for the Calculation of the FFT and Harmonic Frequencies | User Dialog Box with Changing Background Color | User Dialog Box with Curve Preview | User Dialog Box with Extended Table | User Dialog Box with Internet Explorer | User Dialog Box with Scalable Table | User Dialog Box with Selection Lists | User Dialog Box with Selection Lists | User Dialog Box with Subdialog Boxes | User Dialog Box with Tables | User Dialog Box with Tree | Wizard for Tolerance Evaluation

WAS THIS ARTICLE HELPFUL?

Not Helpful