class edit

superclass(es) editControl
subclass(es) maskEdit
description The edit class is a simple single line editor class.

pl_img40.gif (1879 bytes)
see also panel

tasks

An instance of the edit class can be used for entering a single line of text by the user, use the create/7 method to create a normal edit control. An edit control for entering a password can be created by the method createPassword/7. Instead of displaying the entered characters the edit control only displays * characters. A readonly edit control can be created by createReadOnly/7, a readonly control ignores all input from the user but it's text can still be altered through putText/1 of the class window.
Each create method of the class has an options/2 structure, the first argument of this structure determines the text alignment of the text inside the edit control, use one of the following three atoms: left, center or right. The case of the characters is determined by the second argument, the possible argument values are: normal, upper and lower. If upper is specified all characters are displayed as uppercase characters, if normal is used upper- and lowercase characters are displayed as they were entered.

methods

create(Parent, options(Alignment, Case), X, Y, W, H, Output)

func Create a normal edit control, the parent window is specified by Parent, with the specified options for text alignment and case of the characters. The position of the upperleft corner are specified by X and Y, the width and height of the controls are determined by W and H.
pre Parent must refer to a parent window, the Alignment variable must contain one of the following values: left, center or right, the Case variable must contain normal, upper or lower. X, Y, W and H must contain integer values.
post If the edit control was successfully created Output is assigned true, else it is assigned false.

createPassword(Parent, options(Alignment, Case), X, Y, W, H, Output)

func Create a password edit control, the parent window is specified by Parent, with the specified options for text alignment and case of the characters. The position of the upperleft corner are specified by X and Y, the width and height of the controls are determined by W and H.
pre Parent must refer to a parent window, the Alignment variable must contain one of the following values: left, center or right, the Case variable must contain normal, upper or lower. X, Y, W and H must contain integer values.
post If the edit control was successfully created Output is assigned true, else it is assigned false.
Arrow.gif (1632 bytes) A password control displays the same character for each character entered.

createReadOnly(Parent, options(Alignment, Case), X, Y, W, H, Output)

func Create a readonly edit control, the parent window is specified by Parent, with the specified options for text alignment and case of the characters. The position of the upperleft corner are specified by X and Y, the width and height of the controls are determined by W and H.
pre Parent must refer to a parent window, the Alignment variable must contain one of the following values: left, center or right, the Case variable must contain normal, upper or lower. X, Y, W and H must contain integer values.
post If the edit control was successfully created Output is assigned true, else it is assigned false.
Arrow.gif (1632 bytes) A readonly control ignores all input from the user.

putPasswordChar(String)

func Set the character that a password edit control uses for displaying the characters entered.
pre The String variable must contain a string value.
post The first character of String has become the password character.