PTypeToggle

(VTS Library)

Description:

Parameter Setting Type Toggled Field. This module draws a beveled, titled box showing the currently selected tag, numeric value or expression and buttons to modify the value as appropriate.

Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics,  Variable
Related to: GUITransform | PAddressEntry | PAlmPriority | PAreaSelect | PCheckBox | PColorEdit | PColorSelect | PContributor | PDroplist | PEditField | PEditName | PFileChooser | PHSliderBar | PHueSelect | PImageSelect | PIPAddressList | PIPListenerGroup | PMultiCheckBox | PPageSelect | PPhraseEdit | PRadioButtons | PSecBit | PSelectObject | PServerListName | PSpinbox | PTimeZone | SiteDispParms |
Format: \DialogLibrary.PTypeToggle(ParmNum, TagType, Title, FocusID, VertAlign, AlignTitle[, LowLimit, HighLimit, Trigger, EnableExpressions, DrawBevel, PtrValue, Immutable, AllowRootSelection, ParmValueType, StatusLabel])
Parameters:  
ParmNum
Required. Any numeric expression giving the parameter number (from 0) in the caller to alter.
TagType
Required. Any text expression for the type of tag used to create the droplist portion of the graphic. All existing tags of this type will be listed.
Title
An optional parameter that is any text expression to be used as a title for the tool. May be left as Invalid for no title.
FocusID
Boolean. If this value is FALSE (0), the field will display its current setting, but cannot be opened (i.e. its value cannot be changed), and will appear disabled (grayed-out).
VertAlign
Required. Any numeric expression that sets the vertical alignment of the unopened droplist according to one of the following:

VertAlign

Vertical Alignment

0

Top

1

Center

2

Bottom

Whether the title is included when the vertical alignment is calculated is determined by the value of AlignTitle. The default value is 0.

AlignTitle
Required Boolean. If AlignTitle is true (non-0), the title will be included in the calculation for vertical alignment.
If AlignTitle is false (0), the title will be added to the editfield after both the editfield and its bevel have been vertically aligned. The default is true.
LowLimit
An optional parameter that is any numeric expression giving the minimum value to be accepted by the editfield portion of the tool (it does not affect the tag's value if a tag is accepted).

If this parameter is valid and a value less than LowLimit is entered in the field, the variable set by the field will revert to the previous value.
HighLimit
An optional parameter that is any numeric expression giving the maximum value to be accepted by the editfield portion of the tool (it does not affect the tag's value if a tag is accepted).

If this parameter is valid and a value greater than HighLimit is entered in the field, the variable set by the field will revert to the previous value.
Trigger
An optional parameter that is set when the variable is changed.
EnableExpressions
An optional parameter that indicates the initial state of DoEnableExpressions.
If EnableExpressions is set to TRUE, a radio button will be shown that toggles display of the ExpressionEdit widget, which in turn allows users to enter an expression.
EnableExpressions defaults to FALSE, but if the value controlled by the PTypeToggle is already an expression, then the expressions option will be displayed regardless.
DrawBevel
Optional Boolean expression that when set to TRUE, causes a bevel to be drawn around the control. Defaults to FALSE.
PtrValue
Used to return the value of expressions/tags
Immutable
TRUE if we want to force all tag references to generate immutable reference code. Defaults to FALSE.
AllowRootSelection
TRUE to allow the Root tag to be selected. Default is FALSE
ParmValueType

ValueType of the parameter:
0 = Status (boolean)
1 = Short
2 = Long
3 = Double
4 = Text
5 = Octal
6 = Hexadecimal
7 = Color
8 = Object

StatusLabel
Label for the type Status radio button
BrowserObj
Set to the instance of the Tag Browser opened by SelectObject
DefaultTypeParm

Type to use when we have an Invalid value. May be one of:

  • 0 --> Constant (default)
  • 1 --> Expression
  • 2 --> Tag
RootParm
Optional - Object value of the root tag. Defaults to the caller's root.
FcnSelectionMode

Optional Numeric. What type of function should be selectable according to the following:

  • 0 --> Script
  • 1 --> Steady State (all)
  • 2 --> Steady State, no exclusive Steady States
Comments:

This module is a member of the VTScada Dialog Library and must therefore be called from within a GUITransform and prefaced by \DialogLibrary..

This control is not to be used in widget panel modules as it creates undesired output and does not support the range of type selections required for widget configuration. In widget panel modules, use ParameterEdit Snap-ins or NumericParameterEdit instead.

This parameter tool expects the first parameter of its calling module to contain an array of tag parameters. It will then set the element indicated by ParmNum to the numeric value or the name of the selected tag.
The height of the (unopened) droplist, the create new tag button and the radio buttons beneath them are constant, with the horizontal boundaries of the calling transform defining the combined width of the droplist and button, and the vertical boundaries of the calling transform defining the droplist's opened height, which will include the added height of the bevel above the field, but may or may not include the title, depending on the alignment used. Note that if the entire list can be displayed in a smaller area than indicated by the vertical boundaries of the calling transform, the dropped list height will be decreased. The dropped height of the list will always have a minimum height of 1 line (below the field).
For any optional parameter that is to be set, all optional parameters preceding the desired one must be present, although they may be invalid.

Usual height: 55-100 pixels.

Example:

GUITransform(10, 160, 270, 60,
             1, 1, 1, 1, 1,
             0, 0, 1, 0,
             0, 0, 0,
             \DialogLibrary.PTypeToggle(1 { Parm num },
                                        "DigitalOutput"          { Tag type    },
                                        \GetPhrase("Your_Title") { Title       },
                                        TRUE                     { ID          },
                                        0                        { Top align   },
                                        1                        { Align title },
                                        10, 20                   { Limits      }));