SimpleDialogBox class The class can be called from Application class. Creates a user-definable dialog box to collect values during the running of a script.
.
More...
Public Member Functions | |
| void | AddAxisSelection (String &originName, String &vectorName, String &label, int col=0, int colSpan=1) |
| Adds axis selection panel to allow selection of edges. More... | |
| void | AddCheckBox (String &name, String &label, bool defaultValue, int col=0, int colSpan=1) |
| Adds a check box field to the dialog. More... | |
| void | AddComboBox (String &name, String &label, StringList &list, int defaultIndex=0, int col=0, int colSpan=1) |
| Adds a combo box to a dialog. More... | |
| void | AddDirectoryPath (String &name, String &label, String &path, int col=0, int colSpan=1) |
| Adds a filename field to the dialog for a directory name. More... | |
| void | AddInteger (String &name, String &label, int defaultvalue, int col=0, int colSpan=1) |
| Adds an integer field to the dialog. More... | |
| void | AddIntegerList (String &name, String &label, String &defaultValue, int col=0, int colSpan=1) |
| Adds an integer list field to the dialog. More... | |
| void | AddLabel (String &text, int col=0, int colSpan=1) |
| Adds a text label to the dialog. More... | |
| void | AddLine (int col=0, int colSpan=1) |
| Adds a horizontal line to the dialog. More... | |
| void | AddOpenFilename (String &name, String &label, String &path, String &filters, int col=0, int colSpan=1) |
| Adds a filename field to the dialog for existing files. More... | |
| void | AddRadio (String &name, String &label, int value, int col=0, int colSpan=1) |
| Adds a radio field to the dialog. More... | |
| void | AddReal (String &name, String &label, double defaultValue, int col=0, int colSpan=1) |
| Adds a real valued field to the dialog. More... | |
| void | AddSaveFilename (String &name, String &label, String &path, String &filters, int col=0, int colSpan=1) |
| Adds a filename field to the dialog for saving files. More... | |
| void | AddSelectEdgeList (String &name, String &label, int col=0, int colSpan=1) |
| Adds an edge selection field to the dialog for a directory name. More... | |
| void | AddSelectFaceList (String &name, String &label, int col=0, int colSpan=1) |
| Adds a face selection field to the dialog for a directory name. More... | |
| void | AddSelectPartList (String &name, String &label, int col=0, int colSpan=1) |
| Adds a part selection field to the dialog for a directory name. More... | |
| void | AddSelectVertexList (String &name, String &label, int col=0, int colSpan=1) |
| Adds a vertex selection field to the dialog for a directory name. More... | |
| void | AddSpinBox (String &name, String &label, int defaultValue, int col=0, int colSpan=1) |
| Adds a spin box for getting an integer parameter to the dialog. More... | |
| void | AddString (String &name, String &label, String &defaultValue, int col=0, int colSpan=1) |
| Adds a text field to the dialog. More... | |
| Variant | GetMeshGroupIndices (String &name) |
| Returns the indices of mesh group selected in the field of the parameter as integer list. More... | |
| Point * | GetPoint (String &name) |
| Returns a point by its name. More... | |
| Variant | GetSetIndices (String &name) |
| Returns the indices of Set selected in the field of the parameter as integer list. More... | |
| Variant | GetValue (String &name) |
| Returns the value of a parameter. More... | |
| Variant | GetValueAsIntegerList (String &name) |
| Returns the value of a parameter as integer list. More... | |
| bool | IsValid () |
| Returns True if an object is valid. More... | |
| void | SetCancelButtonVisible (bool visible) |
| Specifies the visibility of Cancel button. More... | |
| void | SetHelp (String &helpString) |
| Specifies a help string that will be displayed when the Help button on the dialog is pressed. | |
| void | SetHelpKey (String &helpKey) |
| Since this is an internal function, it is not officially supported. | |
| void | SetMaximum (String &name, Variant &value) |
| Specifies the maximum value of a field. More... | |
| void | SetMinimum (String &name, Variant &value) |
| Specifies the minimum value of a field. More... | |
| void | SetModal (bool on) |
| Specifies the dialog pops up as modal or modeless. More... | |
| void | SetTitle (String &dialogTitle) |
| Specifies the title of the dialog window. | |
| void | SetTooltip (String &name, String &tooltip, int value=-1) |
| Specifies a tooltip on the named field. More... | |
| void | SetTranslation (String &english, String &japanese) |
| Specifies the label text when Japanese is selected as the JMAG display language. More... | |
| int | Show () |
| Shows the dialog box. Returns 1 on OK, 0 on Cancel. | |
| bool | WasCancelled () |
| Returns True if the cancel button was pressed. | |
Detailed Description
SimpleDialogBox class The class can be called from Application class. Creates a user-definable dialog box to collect values during the running of a script.
.
Example of calling the class object:
Member Function Documentation
| void SimpleDialogBox::AddAxisSelection | ( | String & | originName, |
| String & | vectorName, | ||
| String & | label, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds axis selection panel to allow selection of edges.
- Parameters
-
originName The name of the origin that will be used to retrieve its coordinates vectorName The name of the vector that will be used to retrieve its coordinates label The text that will appear in the label col The column of the dialog where the line should be positioned colspan The number of dialog columns the line should cover
| void SimpleDialogBox::AddCheckBox | ( | String & | name, |
| String & | label, | ||
| bool | defaultValue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a check box field to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip().
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial state of the checkbox col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddComboBox | ( | String & | name, |
| String & | label, | ||
| StringList & | list, | ||
| int | defaultIndex = 0, |
||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a combo box to a dialog.
The name should be unique.
The name is passed to GetValue to get the parameter value after the dialog has been shown.
It is also used with SetTooltip.
The return value of the GetValue method is the index of the selected item.
- Parameters
-
name The name of the parameter label The text that will appear in the label list The list of strings to be set in the combo box defaultValue The index of the item to be displayed by default in combo box, initial value of parameter col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddDirectoryPath | ( | String & | name, |
| String & | label, | ||
| String & | path, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a filename field to the dialog for a directory name.
The filename field has a browse button to launch the open directory dialog.
The name should be unique. The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip() .
- Parameters
-
name The name of the parameter label The text that will appear in the label path The initial path used in the directory dialog col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddInteger | ( | String & | name, |
| String & | label, | ||
| int | defaultvalue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds an integer field to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip(), SetMinimum() and SetMaximum().
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial value that will appear in the text box col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddIntegerList | ( | String & | name, |
| String & | label, | ||
| String & | defaultValue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds an integer list field to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip().
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial value that will appear in the text box col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddLabel | ( | String & | text, |
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a text label to the dialog.
- Parameters
-
text The text that will appear in the label col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddLine | ( | int | col = 0, |
| int | colSpan = 1 |
||
| ) |
Adds a horizontal line to the dialog.
- Parameters
-
col The column of the dialog where the line should be positioned colspan The number of dialog columns the line should cover
| void SimpleDialogBox::AddOpenFilename | ( | String & | name, |
| String & | label, | ||
| String & | path, | ||
| String & | filters, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a filename field to the dialog for existing files.
The filename field has a browse button to launch the file open dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip() .
The filter string contains a list of filetypes and wildcards, eg
- Parameters
-
name The name of the parameter label The text that will appear in the label path The initial path used in the file open dialog filters The file type and filter string col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddRadio | ( | String & | name, |
| String & | label, | ||
| int | value, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a radio field to the dialog.
The names of all radio buttons in a single group should have the same name.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
For a radio button group, the value returned by GetValue() will be the value passed in this function for the radio button that is selected.
To set a tooltip on a radio button, also pass the value to the SetTooltip():
- Parameters
-
name The name of the parameter label The text that will appear in the label value The value associated with this button col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddReal | ( | String & | name, |
| String & | label, | ||
| double | defaultValue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a real valued field to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip(), SetMinimum() and SetMaximum().
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial value that will appear in the text box col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSaveFilename | ( | String & | name, |
| String & | label, | ||
| String & | path, | ||
| String & | filters, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a filename field to the dialog for saving files.
The filename field has a browse button to launch the file save dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip() .
The filter string contains a list of filetypes and wildcards, eg
- Parameters
-
value name The name of the parameter label The text that will appear in the label path The initial path used in the file save dialog filters The file type and filter string col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSelectEdgeList | ( | String & | name, |
| String & | label, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds an edge selection field to the dialog for a directory name.
The edge selection field has Edit, Delete, Highlight All, Create Sets, Select Sets and Mesh Groups buttons.
The name should be unique. The name is passed to GetValueAsIntegerList() to get the parameter value and GetSetIndices() to get the set indices and GetMeshGroupIndices() to get the selected mesh group indices after the dialog has been shown.
It is also used with SetTooltip() .
- Parameters
-
name The name of the parameter label The text that will appear in the label col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSelectFaceList | ( | String & | name, |
| String & | label, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a face selection field to the dialog for a directory name.
The face selection field has Edit, Delete, Highlight All, Create Sets, Select Sets and Mesh Groups buttons.
The name should be unique. The name is passed to GetValueAsIntegerList() to get the parameter value and GetSetIndices() to get the set indices and GetMeshGroupIndices() to get the selected mesh group indices after the dialog has been shown.
It is also used with SetTooltip() .
- Parameters
-
name The name of the parameter label The text that will appear in the label col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSelectPartList | ( | String & | name, |
| String & | label, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a part selection field to the dialog for a directory name.
The part selection field has Edit, Delete, Highlight All, Create Sets, Select Sets and Mesh Groups buttons.
The name should be unique. The name is passed to GetValueAsIntegerList() to get the parameter value and GetSetIndices() to get the set indices and GetMeshGroupIndices() to get the selected mesh group indices after the dialog has been shown.
It is also used with SetTooltip() .
- Parameters
-
name The name of the parameter label The text that will appear in the label col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSelectVertexList | ( | String & | name, |
| String & | label, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a vertex selection field to the dialog for a directory name.
The vertex selection field has Edit, Delete, Highlight All, Create Sets, Select Sets and Mesh Groups buttons.
The name should be unique. The name is passed to GetValueAsIntegerList() to get the parameter value and GetSetIndices() to get the set indices and GetMeshGroupIndices() to get the selected mesh group indices after the dialog has been shown.
It is also used with SetTooltip() .
- Parameters
-
name The name of the parameter label The text that will appear in the label col The column number of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddSpinBox | ( | String & | name, |
| String & | label, | ||
| int | defaultValue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a spin box for getting an integer parameter to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip(), SetMinimum() and SetMaximum().
For a spinbox the minimum and maximum values will determine the range of values that can be entered into the spin box.
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial value that will appear in the spin box col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| void SimpleDialogBox::AddString | ( | String & | name, |
| String & | label, | ||
| String & | defaultValue, | ||
| int | col = 0, |
||
| int | colSpan = 1 |
||
| ) |
Adds a text field to the dialog.
The name should be unique.
The name is passed to GetValue() to get the parameter value after the dialog has been shown.
It is also used with SetTooltip(), SetMinimum() and SetMaximum().
- Parameters
-
name The name of the parameter label The text that will appear in the label defaultValue The initial string that will appear in the text box col The column of the dialog where the label should be positioned colspan The number of dialog columns the label should cover
| Variant SimpleDialogBox::GetMeshGroupIndices | ( | String & | name | ) |
Returns the indices of mesh group selected in the field of the parameter as integer list.
- Parameters
-
name The name of the parameter
| Point * SimpleDialogBox::GetPoint | ( | String & | name | ) |
| Variant SimpleDialogBox::GetSetIndices | ( | String & | name | ) |
Returns the indices of Set selected in the field of the parameter as integer list.
- Parameters
-
name The name of the parameter
| Variant SimpleDialogBox::GetValue | ( | String & | name | ) |
Returns the value of a parameter.
- Parameters
-
name The name of the parameterSel
| Variant SimpleDialogBox::GetValueAsIntegerList | ( | String & | name | ) |
Returns the value of a parameter as integer list.
- Parameters
-
name The name of the parameter
| bool SimpleDialogBox::IsValid | ( | ) |
Returns True if an object is valid.
- Returns
- Whether or not the SimpleDialogBox objects in the list are valid
| void SimpleDialogBox::SetCancelButtonVisible | ( | bool | visible | ) |
Specifies the visibility of Cancel button.
- Parameters
-
visible True=1 : VisibleFalse=0 : Hidden
| void SimpleDialogBox::SetMaximum | ( | String & | name, |
| Variant & | value | ||
| ) |
Specifies the maximum value of a field.
For integer and real fields the minimum and maximum values are used to limit the possible values that can be entered in the text box.
For spin boxes the minimum and maximum values determine the range of the spin box.
- Parameters
-
name The name of the parameter to apply the limit to. value The maxiumum value that should be entered
| void SimpleDialogBox::SetMinimum | ( | String & | name, |
| Variant & | value | ||
| ) |
Specifies the minimum value of a field.
For integer and real fields the minimum and maximum values are used to limit the possible values that can be entered in the text box.
For spin boxes the minimum and maximum values determine the range of the spin box.
- Parameters
-
name The name of the parameter to apply the limit to value The minimum value that should be entered
| void SimpleDialogBox::SetModal | ( | bool | on | ) |
Specifies the dialog pops up as modal or modeless.
- Parameters
-
visible True=1 : ModalFalse=0 : Modeless
| void SimpleDialogBox::SetTooltip | ( | String & | name, |
| String & | tooltip, | ||
| int | value = -1 |
||
| ) |
Specifies a tooltip on the named field.
- Parameters
-
name The name of the parameter where the tooltip should be set tooltip The tooltip string value Used for radio buttons only. See the AddRadio() function for details.
| void SimpleDialogBox::SetTranslation | ( | String & | english, |
| String & | japanese | ||
| ) |
Specifies the label text when Japanese is selected as the JMAG display language.
Use SetTranslation() when both English and Japanese are used as the display language.
- When English is selected as the display language, the label text specified by the english argument is displayed as is.
- When Japanese is selected as the display language, the label text specified by the english argument is replaced by the label text specified by the japanese argument. When only English or only Japanese is used as the display language, there is no need to use SetTranslation() . In addition, SetTranslation() cannot be used for text specified by the defaultValue argument of AddString() .
\param english Label text when JMAG display language is English \param japanese Label text when JMAG display language is Japanese
The following is an example: