Scroll to navigation

statevars(3U) InterViews Reference Manual statevars(3U)

NAME

BrushVar, ColorVar, CompNameVar, FontVar, GravityVar, MagnifVar,ModifStatusVar, NameVar, PatternVar - state variable subject subclasses

SYNOPSIS

#include <Unidraw/statevars.h>

DESCRIPTION

Unidraw predefines several state variable subject subclasses:BrushVar, ColorVar, FontVar, and PatternVar store the graphics stateinformation their names suggest; GravityVar records whether gravity isin effect; MagnifVar records the current viewer magnification;ModifStatusVar records whether state-modifying operations have beenapplied to a component being edited; NameVar stores a string ofinterest; and CompNameVar is a NameVar that stores a component andkeeps track of its catalog name. These variables represent state thatis basic to graphical components and state that is often globallyaccessible in graphics applications.

PUBLICOPERATIONS

Each graphics state state variable subclass defines a constructor thattakes an initial value for the state it represents and adds operationsfor assigning and retrieving that state.
The GravityVar constructor takes an initial value that specifieswhether gravity is on or off. IsActive returns the current value, andActivate changes it to the one supplied.
The MagnifVar constructor takes an initial value for the magnificationfactor, and SetMagnify and GetMagnif assign and return the currentvalue.
The ModifStatusVar constructor takes a component instance and aninitial value as arguments. The ModifStatusVar is responsible forindicating whether the given component is modified. GetModifStatus,SetModifStatus, GetComponent, and SetComponent get and set thesearguments. The modification status will be set automatically (ineditors that maintain a ModifStatusVar instance) when an reversibleoperation is performed on the component.
The NameVar constructor takes a string as an optional argument, whileGetName and SetName retrieve and assign the string.
The CompNameVar constructor takes a component as an optional argument.CompNameVar inherits the GetName operation from NameVar; callingGetName returns the name associated with the component that theCompNameVar stores. The GetComponent and SetComponent calls get andset the component. UpdateName updates the string that GetName returnsto reflect the component's catalog name. SetComponent calls thisoperation automatically when it changes the CompNameVar's component.PartOf returns the name of the root component in the CompNameVarcomponent's hierarchy.

SEEALSO

Catalog(3U), Component(3U), Editor(3U), StateVar(3U), pspaint(3U)

6 August 1990 Unidraw