GEOS SDK TechDocs
|
|
3 Using the Generic Classes
|
3.2 Creating a Generic Object Tree
Generic objects have a tremendous amount of built-in functionality. Much of this is built into
GenClass
, the topmost class in the generic class tree. For full details on
GenClass
and the other generic classes, see the Object Reference Book.
Among the features offered by all generic classes are
Each of the different generic classes is described in overview depth below. Note that every one of these classes may be subclassed to add, change, or remove functionality. Changing or removing functions from a generic class is not encouraged, however, as it can cause a specific UI library to give unpredictable results.
GenClass
provides the functionality basic to all generic objects.
GenClass
is not used directly by any applications and has no visible representation. Rather, all generic classes are subclassed off
GenClass
.
GenClass
provides instance fields common to all of its subclasses. Instance fields of special interest include
GenClass also implements scores of hints that can affect UI geometry, visual representation, data structures, and functions.
GenApplicationClass
provides the basic functionality to open and close applications within GEOS. An object of this class serves as the top object in any application for GEOS.
GenPrimaryClass
is a subclass of
GenDisplayClass
. The GenPrimary is the chief UI grouping object of an application, and it usually appears as the application's primary window. An application's GenPrimary object manages all controls and output areas that are invoked when an application is first launched. You will usually create a GenPrimary as the sole child of your GenApplication object.
A GenTrigger is a simple pushbutton that executes an action when activated by the user. Typically, the trigger will have a moniker displayed within it and will be activated by a mouse click or by a special keystroke sequence. GenTriggers are very common in applications.
GenInteraction objects are essentially grouping mechanisms. GenInteractions are the key objects for creating both menus and dialog boxes, and they can be used to organize the geometry of other generic objects. Typically, a GenInteraction will have a number of children, each of which will appear within the interaction on the screen. The Interaction itself may or may not have a visible representation.
The GenView object provides a scrollable window in which the application has complete drawing control. Most applications will use a GenView, and many will use it in conjunction with a VisContent object. The View is extremely powerful, providing all clipping, scrolling, resizing, and scaling automatically. A View can even be splittable or linked to other views. The GenView can display either normal graphic documents or hierarchies of visible objects.
Together, GenBoolean, GenBooleanGroup, GenItem, GenItemGroup, and GenDynamicList provide many different types of lists. List objects may be used to create lists that are dynamic or static; scrollable or not; exclusive, non-exclusive, or otherwise. List objects may appear within menus or dialog boxes as well as within an application's primary window.
The GenValue object allows the user to set a value within a particular range. This may be implemented as a slider, a spinner, or a pair of up/down buttons next to the value. Ranges may use scalar or distance values and can have their maximum and minimum values set by the application.
GenTextClass
is tremendously versatile and can be used for text displays or text-edit fields. The GenText is used by nearly every application that either displays text or requires text input. It is so versatile and powerful that it can provide the power of an entire word processor without any additional code in the application.
The GenText object supports selection and control of fonts, point sizes, text color, paragraph color, paragraph borders, margin settings, tab stops, manual leading, and character kerning, as well as several other features. The text library also provides several controllers that work with the GenText to allow the user to set all these features.
Together,
GenDocumentClass
,
GenDocumentGroupClass
, and
GenDocumentControlClass
provide all the functions necessary to create, save, open, and edit document files. These classes provide not only the UI menus and tools (the File menu) but also the functions for managing the document files. Applications that use these classes never have to call routines to open, close, or save files--all that is done automatically, including the file selector mechanisms to aid the open and save-as functions.
GenDocument objects are created and managed automatically by the GenDocumentGroup. Each document object represents a single file which has been opened or newly created by the user.
Together, the GenDisplay, GenDisplayGroup, and GenDisplayControl provide display windows and the UI gadgetry to manage them. Typically, these objects will be used in conjunction with the document and document control objects to provide one display for each document.
The GenDisplayGroup object creates and manages multiple GenDisplay document windows. The GenDisplayControl object creates and maintains a Window menu to allow the user to operate on the individual displays. If your application will have multiple documents or multiple displays open, you will want to use these objects.
GenControlClass
is used to create UI controller objects. Applications will most likely not use
GenControlClass
directly, though some object libraries might. For example, the Text Library uses controller objects for font control, point size control, and style control, among other things. Any application that uses the Text Library can include the font controller object; the user will then be able to select and apply fonts without the application having to do any work to support it.
The UI and various libraries provide many controllers you can use immediately. Some examples are the
GenEditControlClass
, which creates and maintains the Edit menu and tools;
ColorSelectorClass
, which creates and displays UI gadgetry to set color information; and
GenViewControlClass
, which creates and maintains a View menu allowing the user to set scaling and scrolling behavior.
GenToolControlClass
lets the user select which of an application's tools are available and where they should be placed (in a toolbox, in a menu, etc.). Tools are provided by UI controllers. Typically, an application that uses controllers will provide several tool areas and a GenToolControl; the GenToolControl will automatically create all the UI gadgetry to let the user select which tools are active and where they will appear.
The GenFileSelector provides user interface to allow the user to navigate through his or her file system. It is used most often by the document control objects and is used directly by only some applications.
GenGlyph displays simple text or graphics strings. Text displayed by a Glyph object is not selectable or editable; these objects are typically used for labeling areas or items on the screen.
GenContentClass
is used with a GenView to display other generic UI objects within a scrollable window. The GenContent is rarely used because having some of an application's UI objects not visible can confuse some users. More often, a GenDocument is used as the view's content;
GenDocumentClass
is subclassed from the GenContent.
GEOS SDK TechDocs
|
|
3 Using the Generic Classes
|
3.2 Creating a Generic Object Tree