Generic UI Controllers: 4.1 Creating Your Own Controllers: GenControlClass Instance Data

Up: GEOS SDK TechDocs | Up | Prev: 4 Creating Your Own Controllers | Next: 4.2 Subclassing GenControlClass

GenControlClass has several instance data fields that determine the controller's features and supported tool set. These instance fields, along with the messages defined for the class, are shown in GenControlClass Instance Data .

Code Display 12-6 GenControlClass Instance Data

/* GenControlClass has one static instance data field and several dynamic (vardata)
 * fields. These are shown below. */
	/* The GCI_output field contains the optr of the object to which
	 * the controller is currently sending its "apply" messages. This
	 * field is typically set to a GenTravelOption (such as TO_APP_TARGET)
	 * or a TravelOption (such as TO_OBJ_BLOCK_OUTPUT). */
    @instance		optr	 GCI_output;
	/* Controller class objects are set disabled by default. When the
	 * controller is initialized, it will set itself enabled. */
	@default		GI_states = (@default & ~GS_ENABLED);
/* the following attributes and hints determine the controller's
 * feature set. All of these hints and attributes are described in
 *  Using Controllers. */
    @vardata void			 HINT_GEN_CONTROL_TOOLBOX_ONLY;
    @vardata WordFlags			 ATTR_GEN_CONTROL_REQUIRE_UI;
    @vardata WordFlags			 ATTR_GEN_CONTROL_PROHIBIT_UI;
    @vardata WordFlags			 ATTR_GEN_CONTROL_REQUIRE_TOOLBOX_UI;
    @vardata WordFlags			 ATTR_GEN_CONTROL_PROHIBIT_TOOLBOX_UI;
/* The following two attributes control additional UI gadgetry added to a
 * controller object. */
    @vardata optr			 ATTR_GEN_CONTROL_APP_UI;
	@reloc	ATTR_GEN_CONTROL_APP_UI, 0, optr;
    @vardata optr			ATTR_GEN_CONTROL_APP_TOOLBOX_UI;
	@reloc	 ATTR_GEN_CONTROL_APP_TOOLBOX_UI, 0, optr;
 /* The following two hints allow an application to specify the initial
 * state of a controller including its placement, features, and
 * additional UI objects. */
    @vardata GenControlUserData  HINT_GEN_CONTROL_MODIFY_INITIAL_UI;
    @vardata GenControlUserData  HINT_GEN_CONTROL_USER_MODIFIED_UI;
 /* The following temporary data field is used to determine the tool settings
 * for a controller's set of tools. */
    @vardata TempGenControlInstance  TEMP_GEN_CONTROL_INSTANCE;

In general, a controller class will not have to worry about the instance data fields in GenControlClass Instance Data . Instead, it will handle a particular message, set up some UI resources, and rely on the functionality built into GenControlClass .


Up: GEOS SDK TechDocs | Up | Prev: 4 Creating Your Own Controllers | Next: 4.2 Subclassing GenControlClass