previous chapter contents page top page next chapter

TextField

August 18, 1992last updated January 21, 1994

Defined in TextField.Def 
Inherits from Viewable, HasBorder, TextContainer, AcceptsTyping

Class Description

A text field object contains and displays text. You should use a text field object whenever you want to display text. You can allow users to edit the text in a text field object, or you can make it unchangeable. Text field objects can be framed and colored with coupons.

The basic text field has a large number of specialized heirs, including digit-only fields, date fields, and phone number fields.

Remember that if the documentation and the software (especially the definition files) disagree, always trust the software.

Using a Text Field Object

You can add a text field object to your package by selecting one from the Magic Hat. The Magic Hat provides an entire page full of text field objects to choose from. The text field objects in the Magic Hat differ mainly in their frames, text styles, and label positions. One text field object is actually a digit field object, a subclass of TextField that permits only digits to be entered.

Text field objects can contain text that's been scribbled with a pen as well as typed with the keyboard.

Programming Information

Use: sometimes
Subclass: sometimes
Call its methods: sometimes

You should use a text field object whenever you want a place for the user to see, type, or scribble some text. You should subclass TextField if you want to make a text field object that provides additional features. To make a text field object that restricts input, you should use or subclass the RestrictedField class. You should call the text field object's methods if you want to manipulate the text field object or the text that it contains.

Related Classes

Class TextContainer provides the underpinnings for text fields. Class TextFormatter defines the way that text is displayed in fields.