Edit Field

SUMMARY

Attributes and Binding of Edit Fields

CONTENTS

  1. Attributes
  2. Binding

Attributes

The names of the attributes used in XML-Files, Refresh- and Action-Scripts are denoted in brackets.

Name (Name)

Action (OnAction)
     The action executed by pressing the [ENTER]-Button at the end of an entry.

Style
     The style of the Edit-Field complies to the capabilities Windows offers.

Style Entry in XML Description
Autom. Horiz. Scroll ES_AUTOHSCROLL Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position 0.
Autom. vert. Scroll ES_AUTOHSCROLL Automatically scrolls text up one page when the user presses ENTER on the last line.
Centered ES_CENTER Centers text in a single-line or multiline edit control.
Left-aligned ES_LEFT Left-aligns text in a single-line or multiline edit control.
Lowercase only ES_LOWERCASE Converts all characters to lowercase as they are typed into the edit control.
Multiline ES_MULTILINE Designates a multiple-line edit control. (The default is single line.) If the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If ES_AUTOVSCROLL is not given, the edit control shows as many lines as possible and beeps if ENTER is pressed when no more lines can be displayed. If the ES_AUTOHSCROLL style is specified, the multiple-line edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press ENTER. If ES_AUTOHSCROLL is not given, the control automatically wraps words to the beginning of the next line when necessary; a new line is also started if ENTER is pressed. The position of the wordwrap is determined by the window size. If the window size changes, the wordwrap position changes and the text is redisplayed. Multiple-line edit controls can have scroll bars. An edit control with scroll bars processes its own scroll-bar messages. Edit controls without scroll bars scroll as described above and process any scroll messages sent by the parent window.
Display Sel. always ES_NOHIDESEL Normally, an edit control hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. Specifying ES_NOHIDESEL deletes this default action.
Password ES_PASSWORD Displays all characters as an asterisk (*) as they are typed into the edit control. An application can use the SetPasswordChar member function to change the character that is displayed.
Right-aligned ES_RIGHT Right-aligns text in a single-line or multiline edit control.
Uppercase only ES_UPPERCASE Converts all characters to uppercase as they are typed into the edit control.
Display only ES_READONLY Prevents the user from entering or editing text in the edit control.

Binding

Text

Example
Refresh-Script:
SetVal(Text, OBJ.MyObject.Value);

Action: 
SetVal(OBJ.MyObject.Value, Text);

The attribute ‘Text’ contains the by the user inputted text to be displayed. Via SetVal() the property Value of the Data-Object ‘MyObject’ is assigned to it. Thereby numbers and times are converted to the default string format automatically. If the default is insufficient a converting function must be used.

The action is triggered by the [Enter]-Button. It merely contains the inversion of the Refresh-Script. Here also the default conversion is carried out, which is in most cases sufficient. The only exception are date and time.

Example

Refresh-Script: 
CnvrtTime2Str("DD.MM.YYYY hh:mm:ss", OBJ.MyObject.Time);
//The formatted string is on the stack now
SetVal(Text, ); //The empty argument takes the value from the stack

Aktion:
CnvrtStr2Time("DD.MM.YYYY hh:mm:ss", Text);
//The time-value is on the stack now
SetVal(OBJ.MyObject.Time, ); //The empty argument takes the value from the stack