The Text Objects: 6 Using GenText

Up: GEOS SDK TechDocs | Up | Down | Prev: 5 Using VisText | Next: 7 The Controllers

GenTextClass provides your application with a generic UI object to both display and edit text. The GenText object is a highly functional object, capable of displaying text to the user under a variety of constraints. The object's role is primarily to display text pertaining to user interface operations. The object also provides a wide array of text processing features, however, to display the text in different formats. For more powerful and diverse text formatting (such as word-processing), you should probably use a VisText object instead.

The GenText has many advanced features of the Text Object Library built in. Most of these features may not be useful for cases where you will most likely use a GenText object; GenText is designed for simpler text edit capabilities than incorporating graphics into text, for example. Still, the GenText object provides a great deal of default behavior and, with a little work, a highly powerful and specifically tailored text object.

The GenText object may not only show text to the user but may also allow the user to supply or edit the displayed text. For example, a file copy operation may request the new name to write the file to; a GenText object would allow the user to enter this file name within its text field.

The text object library offers the following key features:

GenText inherits most of its capabilities from VisTextClass which in turn uses the text object library. You may wish to peruse the structure of this library if you want to know more details of how the GenText performs its default behavior.

GenText is used primarily in three situations: First, when you need to display text (such as in a "help" window), the GenText object can act as a non-editable text field with its own scrolling and geometry management. Second, when you need to get textual input not related to word processing or text editing (such as a file name), the GenText can act as an editable field of one or more lines. Third, when simple word processing or text editing in the generic tree is required (as in the NotePad application), the GenText can provide a scrollable, sizable text-edit field. If you want, the editable GenText can even support advanced paragraph and text formatting.

VisText is used in most situations where complex or advanced formatting or publishing features are desired. Typically, a GenView and a VisContent will be used to provide the root of the visible tree and its interaction with the UI. The VisText is much more flexible than the GenText and allows complex publishing and page layout features that would be difficult with GenText. VisText also allows you to have the same interface no matter what specific UI is in use since it is a visible object and not subject to the constraints of the specific UI.


Up: GEOS SDK TechDocs | Up | Down | Prev: 5 Using VisText | Next: 7 The Controllers