Specifying the Default Button

DIAdem 2018 Help


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

DOWNLOAD (Windows Only)


DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help
DIAdem 2020 SP1 Help

Use the Default property for the Button control to define a button in the user dialog box as the default button. The default button is the button that the dialog box highlights. The default button has a wide border. This button is automatically selected if you press <Enter>.

Complete the following steps to create a dialog box where you can select a channel, smooth the channel, and save this channel in a new channel group:

Note  For this example, delete all the data in the Data Portal and load the data file report_expl.tdm from the library folder.
  1. Select the DIAdem SCRIPT panel.

  1. Select Edit»Create Dialog Box.

  2. Click the ChnComboBox control on the Controls bar. 

  3. Drag open the control in the dialog box.

  4. Click the Button control on the Controls bar. 

  5. Drag open the control in the dialog box. Position the button to the left under the ChnComboBox control.

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

  7. Click the column on the right of the Default field on the Properties tab. Select 1–Yes to define this button as the default button. Button1 must be selected.

  8. Click ... in the EventClick field on the Events tab. Button1 must be selected.

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

    Sub Button1_EventClick(ByRef This)
      If (ChnComboBox1.Text<>"") Then                         ' channel selected
        Dim oGrp, oChn
        Set oGrp = Data.Root.ChannelGroups.Add("Smooth")      ' create new channel group 
        Call oGrp.Activate                                    ' set as default group 
        Set oChn = oGrp.Channels.Add(ChnComboBox1.Value&"_Smooth",DataTypeFloat64) ' create channel name
        Call ChnSmooth(ChnComboBox1.Text,oChn,12,"maxNumber") ' smooth channel
      Else ' no channel selected 
        Call MsgBoxDisp("Please select channel") 
        ChnComboBox1.SetFocus ' focus on channel selection list 
      End If
    End Sub
    Note  Add the above text to the lines generated automatically by the script editor.
  10. Select View»Script View.

  11. Click the Button control on the Controls bar. 

  12. Drag open the control in the dialog box. Position the button to the right below the ChnComboBox control.

  13. Click the column to the right of the Text field in the Properties tab and enter CloseButton2 must be selected.

  14. Click the column on the right of the ButtonType field on the Properties tab. Select 0–Cancel to close the user dialog box when the button is clicked.

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

  16. Select View»Test in DIAdem.

  17. Select a channel from the selection field and press <Enter> to smooth this channel. The user dialog box generates the new channel group Smooth in the Data Portal and stores the result channel of the smoothing function there. Click Close to close the user dialog box.

  18. 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