Difference between revisions of "Extensions.HMI.ChoiceDialog"

From emotive
Jump to navigation Jump to search
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''ChoiceDialog'''}}[[Category:HMI]]
 
{{DISPLAYTITLE:  '''ChoiceDialog'''}}[[Category:HMI]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | ChoiceDialog | Dialog that indicates to the user with a list of choices | [[Action]]| [[Extensions.HMI|OTX HMI extension]] | [[Dialog related actions]] | [[OutOfBoundsException]] | [[Extensions.HMI.HMIChk001|HMI_Chk001]] }}
+
{{ClassificationActivity | ChoiceDialog | Dialog that indicates to the user with a list of choices | [[Action]]| [[Extensions.HMI|OTX HMI extension]] | [[Extensions.HMI#Actions|Dialog related actions]] | [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] | [[Extensions.HMI.HMIChk001|HMI_Chk001]] }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Hmi.ChoiceDialog(StringTerm, StringTerm, IntegerVariable, ListTerm);
+
HMI.ChoiceDialog(StringTerm message, StringTerm title, ListTerm options, IntegerTerm default, IntegerVariable result);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''ChoiceDialog''' shows the user a list of choices. Once the user has confirmed the selection of the options (eg by clicking on the "OK" button), the dialog is closed and the index of the selected option will be assigned to a result variable.
+
The '''ChoiceDialog''' will present a list of options to the user. It will be possible for the user to select one of the options and to dismiss the dialog (e.g. by double-clicking an option or by clicking an "OK" button, etc.). Once the dialog is dismissed, the chosen option's index will be assigned to a result variable. It will not be possible to dismiss the dialog unless a choice has been made.
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Options | [[Core.DataTypes.ComplexDataType.ContainerDataType.List|List]] | [[Term]] | - | [1] | This element specifies a list of strings which contains the possible options that shall be displayed.}}
+
{{TableRowPropertie2| Options | [[Core.DataTypes.ComplexDataType.List|List]] | [[Term]] | - | [1] | This element specifies a list of strings which contains the possible options that will be displayed.}}
{{TableRowPropertie2| Default | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Term]] | - | [0..1] | This optional element represents the index of the option which shall be preselected in the dialog.}}
+
{{TableRowPropertie1| Default | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Term]] | - | [0..1] | This optional element represents the index of the option which will be preselected in the dialog.}}
{{TableRowPropertie1| Result | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Variable]] | - | [1] | The integer variable where the chosen option's index.}}
+
{{TableRowPropertie2| Result | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Variable]] | - | [1] | This element indicates the integer variable where the chosen option's index will be assigned to:
 +
* 0 :The 1st option was selected.
 +
* n-1: The nth option was selected.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 +
List<String> Options1 = {"Option1", "Option2"};
 
Integer Integer1;
 
Integer Integer1;
List<String> Options1 = {"Option1", "Option2"};
 
  
Hmi.ChoiceDialog("Massage", "Title", Integer1, Options1);
+
/// Flow
 +
 
 +
HMI.ChoiceDialog("Message", "Title", Options1, 1, Integer1);
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 02:33, 13 September 2019

Classification

Name ChoiceDialog
Short Description Dialog that indicates to the user with a list of choices
Class Action
Extension OTX HMI extension
Group Dialog related actions
Exceptions OutOfBoundsException
Checker Rules HMI_Chk001
Standard Compliant Yes

OTL Syntax

HMI.ChoiceDialog(StringTerm message, StringTerm title, ListTerm options, IntegerTerm default, IntegerVariable result);

Description

The ChoiceDialog will present a list of options to the user. It will be possible for the user to select one of the options and to dismiss the dialog (e.g. by double-clicking an option or by clicking an "OK" button, etc.). Once the dialog is dismissed, the chosen option's index will be assigned to a result variable. It will not be possible to dismiss the dialog unless a choice has been made.

Properties

Name Data Type Class Default Cardinality Description
Options List Term - [1] This element specifies a list of strings which contains the possible options that will be displayed.
Default Integer Term - [0..1] This optional element represents the index of the option which will be preselected in the dialog.
Result Integer Variable - [1] This element indicates the integer variable where the chosen option's index will be assigned to:
  • 0 :The 1st option was selected.
  • n-1: The nth option was selected.

OTL Examples

/// Local Declarations

List<String> Options1 = {"Option1", "Option2"};
Integer Integer1;

/// Flow

HMI.ChoiceDialog("Message", "Title", Options1, 1, Integer1);

See also

ConfirmDialog
InputDialog
ShowDocumentDialog