class editControl

superclass(es) control
subclass(es) edit - memo
description The editControl class is an abstract base class for the edit and memo classes. It contains all shared methods that relate to managing an edit control.
see also panel

tasks

The options of an edit control can be queried by the methods alignLeft/1, alignCenter/1, alignRight/1, lowerCase/1, upperCase/1, password/1, wordWrap/1, wantENTER/1, readonly/1 and textChanged/1.

The current range of characters selected can be retrieved by the method selection/2, the selected characters is returned by selection/1. Removing the current selection can be achived by calling the method cut/0 or deleteSelection/0, the current selection can be replaced by the method replaceSelection/1, removing all text is done if clearAll/0 is called. The selection can be set by putSelection/2 and selectAll/0.

methods

cut

func Cut the current selected text from the edit control. The text is put on the clipboard.
pre TRUE.
post The control has no selected text anymore.

clearAll

func Clear all the text inside the control.
pre TRUE.
post The control contains no text.

alignLeft(Output)

func Check if the text inside the control is left aligned.
pre TRUE.
post If the text is left aligned true is assigned to Output, else is false assigned.

alignCenter(Output)

func Check if the control centers the text.
pre TRUE.
post If the text is centered true is assigned to Output, else is false assigned.

alignRight(Output)

func Check if the text inside the control is right aligned.
pre TRUE.
post If the text is right aligned true is assigned to Output, else is false assigned.

lowerCase(Output)

func Check if the text inside the control is always converted to lowercase characters.
pre TRUE.
post If the text is always lowercase true is assigned to Output, else is false assigned.

upperCase(Output)

func Check if the text inside the control is always converted to lowercase characters.
pre TRUE.
post If the text is always lowercase true is assigned to Output, else is false assigned.

password(Output)

func Check if all the text inside the control is displayed using the same character, this is useful for entering passwords as the actual characters of the entered are not displayed.
pre TRUE.
post If the control is suitable for entering passwords then is true assigned to Output, else is false assigned.

wordWrap(Output)

func Check if the control breaks up lines that are too long by wrapping the words.
pre TRUE.
post If the control does word wrapping then is true assigned to Output, else is false assigned.

wantENTER(Output)

func Check if the control respond to the pressing of the ENTER key or that it passes the key to it's parent window. If the ENTER key event is passed to the frame window then the frame closes itself.
pre TRUE.
post If the control uses the ENTER key event then true is assigned to Output, else false is assigned.
Arrow.gif (1632 bytes) A memo control does not pass the ENTER key event to it's parent window.

readOnly(Output)

func Check if the control is read-only or not. A read-only control ignores all events from the user.
pre TRUE.
post If the control is read-only then true is assigned to Output, else false is assigned.

putReadOnly(YesNo)

func Make the control read-only or remove the read-only property.
pre YesNo must contain true or false.
post If YesNo was true the control was made read-only, else the text has become editable again.

textChanged(Output)

func Determine if the "text changed" flag was turned on or off. This internal flag is turned on if the user makes changes to the text or if the flag is set by the method putTextChanged/1.
pre Output must contain true or false.
post If Output was true the control was made read-only, else the text has become editable again.

putTextChanged(YesNo)

func Raise or lower the text changed flag of the edit control, if the user makes changes to the text of the control then this flag is set.
pre YesNo must contain true or false.
post If YesNo was true the flag was set, else the flag was reset.

selection(Start, End)

func Get the start and end index of the selection of the control, the index of the first character is 0.
pre TRUE.
post If there was no selection then Start and End both contain the position of the current point of insertion, else the Start variable contains the index of the first character of the selection and End the index of the last character of the selection.

selection(String)

func Get the selected text from the control.
pre TRUE.
post If there was no selection then String is not assigned a value, else it is assigned the selected text.

replaceSelection(String)

func Replace the selected text of the control by the contents of the variable String or insert the value of String into the text of the control. The current point of insertion of the control determines where the text is inserted.
pre The String variable must contain a text value.
post If there was no selection then the text was inserted before the first character of the edit control, else the selection of the control was replaced by the value of the variable String.

putSelection(Start, End)

func Put the selection of the control, the start and end index of the selection must be specified. The index of the first character is 0.
pre The Start and End variables must contain an integer value.
post The selection of the control was set to the range of characters specified by the contents of the variables Start and End.

selectAll

func Select all the text of the edit control.
pre TRUE.
post All the text of the control is selected.

deleteSelection

func Delete the selected text of the edit control.
pre TRUE.
post All the selected text of the control was selected.

putLimitText(MaxNum)

func Set a maximum on the number of characters that can be entered.
pre The variable MaxNum must contain an integer value.
post No more than MaxNum characters can be entered in the control. If the control already contains too much characters than no characters are deleted. If MaxNum was 0 the limit on the maximum number of characters was removed.

callbacks

onCut(Sender)

func This callback event is executed when text is cut from the edit control.
pre The variable Sender refers to the window from text is being cut.
post TRUE.

onCopy(Sender)

func This callback event is executed when text is copied from the edit control.
pre The variable Sender refers to the window from which text is being copied.
post TRUE.

onPaste(Sender)

func This callback event is executed when text is pasted into an the edit control.
pre The variable Sender refers to the window into which text is being pasted.
post TRUE.

onClear(Sender)

func This callback event is executed when text is cleared inside an edit control.
pre The variable Sender refers to the window from text is being cleared.
post TRUE.
Arrow.gif (1632 bytes) The difference between the onCut/1 event and this event is that this event is also executed when the method clearAll/0 is executed.