PEditField

(Dialog Library)

Description:

Parameter Setting Editfield. This module draws an editfield with (optional) title and bevel.

Note: PPhraseEdit is recommended for use instead of PEditField in most situations where the parameter is text.

Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: GUITransform | PAddressEntry | PAlmPriority | PAreaSelect | PCheckBox | PColorEdit | PColorSelect | PContributor | PDroplist | PEditName | PFileChooser | PFileChooser | PHSliderBar | PHueSelect | PImageSelect | PIPAddressList | PIPListenerGroup | PMultiCheckBox | PPageSelect | PPhraseEdit | PRadioButtons | PSecBit | PSelectObject | PServerListName | PSpinbox | PTimeZone | PTypeToggle | SiteDispParms
Format: \DialogLibrary.PEditField(ParmNum [,Title, DataType, FocusID, Trigger, View, DrawBevel, VertAlign, AlignTitle, LowLimit, HighLimit, PrivNotReq, Style, PrefixValue, PostfixValue, PlaceHolder])
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.
DataType
Defaults to 4 unless otherwise specified.

DataType

Type

0

Byte (unsigned)

1

Short (2 byte signed)

2

Long (4 byte signed)

3

Double precision floating point (8 byte signed)

4

Text

5

Octal (4 byte unsigned)

6

Hexadecimal (4 byte unsigned)

For types 0 - 2, if the number entered into the field is prefaced by a "0x" the value is taken to be hexadecimal format, and if it is prefaced by a "0" it is considered to be octal. In either case, the value is converted to decimal format when return is pressed or the focus is lost.
For type 5, regardless of whether the number entered into the field is prefaced by a "0" the value is taken to be octal and will be displayed as such. The actual type of Variable will be text.
Type 6, like type 5 will be kept in its declared format of hexadecimal regardless of whether the number entered into the field is prefaced by a "0x". The actual type of Variable will be text

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. 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 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.
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
PlaceHolder
Optional text to be displayed in the field when there is otherwise no valid value.
Typically provides context or instructions to the user. This is not a default value for the parameter.
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 (Pcheck box, 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.

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, 15,
               1, 1, 1, 1, 1,
               0, 0, 1, 0,
               0, 0, 0,
               \DialogLibrary.PEditField(1             { Parm num          },
                                         \GetPhrase("Your_Title")  { Title },
                                         3             { Type float        },
                                         TRUE          { FocusID           },
                                         0             { Trigger not req'd },
                                         Invalid       { Use default view  },
                                         0             { No bevel          },
                                         Invalid       { Default alignment },
                                         1             { Align title       },
                                         98.6          { Minimum value     },
                                         Invalid       { No maximum value  }));

 

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