sDlgTitle | (String) Title of the input window |
---|---|
sDlgStyle | (String) Style of the window. Example: "left:100;top:200;z-order:topmost;button-cancel:no;"
left - Position of the left window side relative to the whole screen (in pixels). For the position definition can be used, for example, PmgObject.ScreenX or PmaPanel.ScreenX property.
right - Position of the right window side relative to the whole screen (in pixels). Don't set if left is specified. If left nor right is not specified, then the window will be centered horizontally.
top - Position of the top window side relative to the whole screen (in pixels). For the position definition can be used, for example, PmgObject.ScreenY or PmaPanel.ScreenY properties.
bottom - Position of the bottom window side relative to the whole screen (in pixels). Don't set if top is specified. If top and bottom is not specified, then the window will be centered vertically.
z-order - value topmost means that the window will be on top of all Windows windows.
button-cancel - Appearance of the Cancel button. The no value means that the button will not be seen. |
vItemValue | [for read and write] (Variant) variable (or array of variables) for entering the value |
vItemName | (Variant) Description (or array of descriptions) to the vItemValue variable |
vItemType | (Variant) text (or array of texts) specifies the type of the entered value:
"string" - Text is entered (String data type). The graphic form for entering is the EditBox.
vItemAttr1 (Integer type) specifies the maximum number of visible characters (i.e. it affects the width of the EditBox). The maximum length of the entered text is 1000 characters. If the number of visible characters is less than the number of entered characters, then it is possible to scroll in the input box by the cursor.
"int" - An integer (Long data type) is entered. The graphic form for entering is the EditBox.
"real" - The real number (Double data type) is entered. The graphic form for entering is the EditBox.
"bool" - The true or false value (Boolean data type) is entered. The graphic form for entering is the CheckBox.
"enum" - The selection from several defined options. Non-negative integer (Long data type) is entered. It represents the index (zero-based index) of the selection from several options. The graphic form for entering is the ComboBox.
vItemAttr1 (Integer type) specifies the maximum number of visible characters (i.e. it specifies the width of the ComboBox).
vItemAttr2 (String type) specifies options. It is the text of words separated by the | character (i.e. pipe sign), for example "option1|option2".
The value in the vItemValue (of the Long type) specifies a word at the beginning that will be pre-selected. There is the index of the selected word at the end. "password" - Text (String data type) is entered as a password. The graphic form for entering is the EditBox and instead of entering characters only stars * can be seen.
vItemAttr1 and vItemAttr2 have the same meaning as for the "string" type. "static" - It doesn't serve for entering. Only static text can be seen that is in the vItemName parameter. There can be and they are active characters "new line" in this text (see vbCrLf constant) and it occurs to line breaking if the text is too wide.
The vItemValue parameter is not used - set it to: null for JavaScript or Empty for VBScript. vItemAttr1 (String type) specifies the appearance of the static text. If not set, then the text is aligned to the left. If the "center" text is set, then the text is centered.
|
vItemAttr1 | [optional] (Variant) The first attribute (or array of attributes) whose meaning changes according to vItemType |
vItemAttr2 | [optional] (Variant) The second attribute (or array of attributes) whose meaning changes according to vItemType |
Dim val
val = 3.14
If Pm.InputBox("Enter value", "", val, "Power", "real", 0, 100) Then
' InputBox has been closed by the "OK" button
Pm.Debug "val=" & val
End If
Dim sText
sText = "Error in starting the security mode" & vbCrLf & "Temperature out of the permitted range"
Pm.InputBox "Critical error", "button-cancel:no;left:300;top:300;", Empty, sText, "static", "center"
Dim oNumber, val, sStyle
Set oNumber = pMe.Pm("/Number")
val = oNumber.Value
sStyle = "right:" & pMe.ScreenX & ";top:" & pMe.ScreenY & ";"
If Pm.InputBox("Enter value", sStyle, val, "Power", "real", 40, 80) Then
' InputBox has been closed by the "OK" button
oNumber.Value = val
End If
Dim arrValue, arrName, arrStyle, arrAttr1, arrAttr2, ret
arrValue = Array("Sorting", true, 2, 0.4, Empty, 1)
arrName = Array("Name of the process", "Enabled", "number of repetitions", "Percentage of success rate", "", "Regime selection")
arrStyle = Array("string", "bool", "int", "real", "static", "enum")
arrAttr1 = Array(20, Empty, 0, 0, Empty, 20)
arrAttr2 = Array(Empty, Empty, 10, 1, Empty, "Batch|Continuous|Discrete")
ret = Pm.InputBox("Input data", "z-order:topmost;", arrValue, arrName, arrStyle, arrAttr1, arrAttr2)
If ret Then
' InputBox has been closed by the "OK" button
Pm.Debug("Name of the process:" & arrValue(0))
Pm.Debug("Enabled:" & arrValue(1))
Pm.Debug("number of repetitions:" & arrValue(2))
Pm.Debug("Percentage of success rate:" & arrValue(3))
Pm.Debug "Regime selection:" & arrValue(5)
End If