previous chapter contents page top page next chapter

ColorMatrix

October 5, 1992
last updated January 21, 1994

Defined in Goodies.Def 
Abstract
Inherits from Box

Class Description

Class ColorMatrix defines objects that provide a rectangular palette of colors. When the user drags a color out of a color matrix, it becomes a color coupon that can be dropped into another object, coloring that object.

ColorMatrix is an abstract class. The system includes one subclass of class ColorMatrix: class ColorBox, which is a collection of assorted colors.


WARNING! You've probably noticed another subclass, class ColorMixer. The definition for class ColorMixer is still in Goodies.Def, but the class itself is not in the system. At some time in the future, Magic Cap might support color, and class ColorMixer will then enjoy a renaissance. Until that happy day, please don't try to use it.


Remember that if the documentation and the software (especially the definition files) disagree, always trust the software.

Using a ColorMatrix Object

ColorMatrix is a subclass of Box. ColorMatrix objects maintain a box size value that determines the size of the color swatches inside the palette. The Magic Hat contains a sample of a color box.

Programming Information

Instantiate: never
Subclass: rarely
Call its methods: rarely

The ColorMatrix class is abstract; you can't create or work with any objects of type ColorMatrix. You might create your own subclass of ColorMatrix if you want to make a class that uses a collection of colored rectangles that differs from the subclasses of ColorMatrix already in the system.

It's very unlikely that you'll call any methods of class ColorMatrix. Class ColorMatrix defines very few methods, most of which are overrides to implement the basic behavior of color matrix objects.

Methods you might call

The ColorMatrix class has the following method that you might call:

Method Description
SetBoxSize Change the size of the matrix's color swatches

Description of fields

The ColorMatrix class defines the following fields:

Field Type Description
Inherited from SingleLinkable
next Object Next item in view list
Inherited from Linkable
previous Object Previous item in view list
Inherited from Viewable
superview Viewable Container for this object
subview Viewable Object contained by this object
relativeOrigin Dot Origin relative to superview
contentSize Dot Size of content rectangle
viewFlags Unsigned Property settings
labelStyle TextStyle Text style of object's label
color Color Color of object's content
shadow Shadow Shadow drawn with object
sound Sound Sound associated with object
Inherited from HasBorder
border Border Frame drawn around object
Defined by ColorMatrix
boxSize Micron Size of each edge of color swatch

Method Descriptions

SetBoxSize

attribute BoxSize: Micron, safe, common
// operation SetBoxSize (edgeSize: LongInt)

Call: sometimes
Override: rarely

Call SetBoxSize to set the size of each edge of each color swatch in the color matrix. SetBoxSize simply sets the value of the color matrix object's boxSize field.