PSelectObject

(Dialog Library)

Description:

Parameter Setting Select Tag Object Tool. This module draws a beveled, titled box showing the currently selected tag, a button to modify the connection in the hierarchy, and a new tag creation button.

Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: GUITransform | PAddressEntry | PAlmPriority | PAreaSelect | PCheckBox | PColorEdit | PColorSelect | PContributor | PDroplist | PEditField | PEditName | PFileChooser | PHSliderBar | PHueSelect | PImageSelect | PIPAddressList | PIPListenerGroup | PMultiCheckBox | PPageSelect | PPhraseEdit | PRadioButtons | PServerListName | PSecBit | PSpinbox | PTimeZone | PTypeToggle | SiteDispParms
Format: \DialogLibrary.PSelectObject(ParmNum, TagType [, Title, FocusID, VertAlign, AlignTitle, DisableDeselect, DrawBevel, AllowRootSelection, DefaultText, MissingText])
Parameters:  
ParmNum
Required. Any numeric expression giving the parameter number (from 0) in the caller to alter.
TagType
Required. May be a text expression for the type or type-group of tag to be used to create the droplist. (Type-groups include "ports", "drivers", "analogs", etc.)
Alternatively, this may be an array of types. The array may not include groups.
All existing tags of the type or types will be listed.
Title
An optional parameter that is any text expression to be used as a title for the droplist. If not provided, the title will be blank.
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
An optional parameter that is 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
An optional parameter that is any logical expression. 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.
DisableDeselect
Optional Boolean. Set TRUE to disable the Deselect button
DrawBevel
Optional Boolean expression that when set to TRUE, causes a bevel to be drawn around the control. Defaults to FALSE.
AllowRootSelection
Optional Boolean. Set TRUE to allow the Root tag to be selected. Default is FALSE
DefaultText
Optional text. What to display in place of "No tag selected".
MissingText
Optional text. What to display in place of "--Missing--".
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 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 chosen item.
The height of the (unopened) droplist and the create new tag button are constant, with the horizontal boundaries of the calling transform defining their combined width, 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: 45 pixels.

  IF Watch(1); 
  [
    TagTypes = New(3);
    TagTypes[0] = "Calculation";
    TagTypes[1] = "AnalogInput";
    TagTypes[2] = "AnalogStatus";
    TagTypes[3] = "AnalogOutput";
    TagTypes[4] = "AnalogControl";
  ]
  GUITransform(170, 160, 370, 60,
               1, 1, 1, 1, 1,
               0, 0, 1, 0,
               0, 0, 0,
               \DialogLibrary.PSelectObject(2           { Parm num           },
                                            TagTypes    { Tag type           },
                                            \GetPhrase("Your_Title") { Title },
                                            TRUE        { Focus ID           },
                                            1           { Center list        },
                                            0           { Align top of bevel }));