|DIAdem 2017 Help|
|DIAdem 2018 Help|
|DIAdem 2019 Help|
|DIAdem 2020 Help|
|DIAdem 2020 SP1 Help|
Use the EventInitialize event to fill a selection list with the selection terms and the related return values displayed in the user dialog box, using a script. Use the controls ComboBox and ListBox to define a selection list in the user dialog box.
|Note You also can fill selection lists with selection terms when you create a user dialog box in the dialog editor. Select ListItems on the Properties tab.|
Complete the following steps to fill a selection list with the texts read from an ASCII file, using a script:
Select the DIAdem SCRIPT panel.
Select File»New»User Variables.
Delete the contents of the file and enter or copy the following text in the script editor:
This file contains selection terms that can be displayed in a ComboBox or in a ListBox.
Select File»Save As, select the All files(*.*) file type and save the file as Combo.asc
Select Edit»Create Dialog Box.
Click the OK and Cancel control group in the Catalog window and click and drag the group into the dialog box.
Click the ComboBox control on the Controls bar.
Drag open the control in the dialog box.
Click ... in the EventInitialize field on the Events tab. ComboBox1 must be selected.
Enter or copy the following text into the script editor:
Sub ComboBox1_EventInitialize(ByRef This) Dim i, intMyHandle, strMyText, intMyError Call This.Items.RemoveAll i = 1 intMyHandle = TextFileOpen(ScriptWritePath&"Combo.asc",eTextFileAttributeRead) ' open file Do While Not TextFileEOF(intMyHandle) ' as long as file contains texts strMyText = TextFileReadLn(intMyHandle) ' read text from file Call This.Items.Add(strMyText, i) ' create another entry i = i + 1 Loop intMyError = TextFileClose(intMyHandle) ' close file End Sub
Select File»Save As and save the file as Test.sud.
Select View»Test in DIAdem.
Open the selection list. The selection list contains all the texts that are located in the Combo.asc file.
Close the user dialog box in DIAdem.
Close the dialog editor.
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