PPhraseEdit

(Dialog Library)

Description:

Language-sensitive, parameter-setting editfield. This module draws an editfield with (optional) title and bevel. Recommended in place of the older PEditField.

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 | PRadioButtons | PSecBit | PSelectObject | PServerListName | PSpinbox | PTimeZone | PTypeToggle | SiteDispParms
Format: \DialogLibrary.PPhraseEdit(ParmNum, Title, FocusID[, Trigger, View, DrawBevel, VertAlign, MinVal, MaxVal, PrivNotReq, Style, PrefixValue, SuffixValue])
Parameters:  
ParmNum
Required. Any numeric expression giving the parameter number (from 0) in the caller to alter.
Title
An optional parameter that is any text expression to be used as a title for the field.
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).
Trigger
Optional. Trigger provides feedback. While editing, the value will be 0. When editing is complete (tab, enter or loss of focus) the value will change to non-zero: 1 if enter is pressed, 2 otherwise.
View
An optional parameter indicating how to display the editfield , as follows. The default value is 2 if FocusID is 0 and 1 otherwise.

View

Display mode

0

Invisible

1

Normal (color scheme - no graying)

2

Grayed-out (only if FocusID is 0)

This parameter may be used to force an editfield with a FocusID of 0 to display normally, rather than allowing it to default to its grayed color.
Note that if the FocusID is not 0, setting this value as 2 will not force the field to gray out.

DrawBevel
Optional Boolean expression that when set to TRUE, causes a bevel to be drawn around the control. Defaults to TRUE. If the editfield is beveled, its size will become fixed and will be the same as that for a droplist.
VertAlign
An optional parameter that is any numeric expression that sets the vertical alignment of the editfield according to one of the following options:

VertAlign

Vertical Alignment

0

Top

1

Center

2

Bottom

Whether the title is included when the vertical alignment is calculated as 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.
LowLimit
An optional parameter that is any expression giving the minimum value or minimum number of characters to be accepted by the editfield (depending on the data type). This value may be a decimal, octal or hexadecimal value. If this parameter is valid and a value less than LowLimit is entered in the field (or there are too few characters, in the case of text value), the variable set by the field will revert to the previous value. No default
HighLimit
An optional parameter that is any numeric expression giving the maximum value or maximum number of characters to be accepted by the editfield (depending on the data type). This value may be a decimal, octal or hexadecimal value. If this parameter is valid and a value greater than HighLimit is entered in the field (or there are too many characters, in the case of text value), the variable set by the field will revert to the previous value.
PrivNotReq
An optional parameter that is any logical expression. If set to true (non-0), anyone can change the value in this editfield. If set to FALSE (0), only those users whose user accounts have been granted the "TagModify" privilege may set it. The default value is false.
Style
An optional parameter indicating the style of the PEditField object. It is a bit-wise field made up of the sum of the following values, to yield the desired effects.

Bit

Value

Definition

0

1

Reserved for bit compatibility with WinComboCtrl, and should be set to "0"

1

2

Reserved for bit compatibility with WinComboCtrl, and should be set to "0"

2

4

Input is converted to all uppercase (note 1)

3

8

Input is converted to all lowercase (note 1)

4

16

Input is masked. Any characters typed will appear as asterisks. This is useful for such things as password fields

5

32

Multiline editing. Setting this bit causes a typed <CR> (Enter or Return) to be interpreted as "move to the start of the next line". Text that contains <CR> characters has a line break inserted at each

6

64

Reserved

7

128

8

256

Reserved

9

512

Not used. Height is defined by \EditHt or TEditHt (with title).

If neither values 4 or 8 are set, input is passed to script code as typed.

PrefixValue
An optional parameter indicating the text expression that should be displayed immediately before (i.e. to the left of) the editable part of the control.
SuffixValue
An optional parameter indicating the text expression that should be displayed immediately after (i.e. to the right of) the editable part of the control. No Default
Comments:

This module is a member of the VTScada Dialog Library and must therefore be called from within a GUITransform and prefaced by \DialogLibrary..
The "P" tools (PCheckBox, PContributor, PColorSelect, PDroplist, and PEditField) were intended only for use in configuration folders and drawing panel modules, and therefore are subject to the system security restraints.

When more than one language is enabled in the application, a phrase-editing button is provided at the right edge of the field. Optionally, the phrase editor will open automatically when VTScada detects that new or untranslated text is entered into the field.

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 value in the editfield.
The height of the editfield is constant, with the horizontal boundaries of its calling transform defining its width, and the vertical boundaries of its calling transform defining the boundaries in which it is to be confined vertically, which will include the added height bevel, but may or may not include the title, depending on the alignment used.

Usual height: 45 pixels.

Examples:

GUITransform(10, 215, 225, 45,
             1, 1, 1, 1, 1,
             0, 0, 1, 0, 0, 0, 0,
             \DialogLibrary.PPhraseEdit(1, 
                                        \GetPhrase("AddDotDotDotLabel"),
                                        TRUE                     { ID }, 
                                        0                   { trigger }, 
                                        2, 
                                        0));

Notice in the above example that the last parameter could have been omitted, because it is optional and its setting matches the default.