Generic UI Controllers: 4 Creating Your Own Controllers

Up: GEOS SDK TechDocs | Up | Down | Prev: 3 Using Controllers | Next: 5 GenToolControlClass

To create your own controller classes, you will have to subclass GenControlClass and handle certain messages and data structures. Most applications, however, will find that the controller classes provided with GEOS are adequate for their needs. Some library programmers may want to create their own controller classes.

GenControlClass is a subclass of GenInteractionClass . All instance data, hints, and messages appropriate for a GenInteraction are also appropriate for a GenControl object.

Typically, when you create your own controller, you will create a library in which the controller will reside. The controller may be in a library with a particular data object (e.g. PointSizeControlClass is part of the text library), or it may be in a library all by itself. For this discussion, the controller is considered to be part of a larger library.

The files of this library are

psCtrl.gp
The global parameters file for the controller's library. Only those portions of this file that pertain to the controller are discussed in this section.
psCtrl.goh
The header file containing the class definition of the controller class. This is separated from the class' code so the user of the controller can include the .goh file and thereby the controller.
psCtrl.goc
The code and resource file of the controller class. This file contains the UI objects and the methods of the controller.

All of these files are detailed throughout the following subsections. Each code display explains in which of these files it belongs.


Up: GEOS SDK TechDocs | Up | Down | Prev: 3 Using Controllers | Next: 5 GenToolControlClass