Constructors

The constructors for the special purpose attribute bundles are described under the heading "Special purpose bundles" on page 143. This section describes the TGrafBundle constructors. The default TGrafBundle constructor sets all attribute settings to Nil. In addition, TGrafBundle has two copy constructors. One lets you copy the attribute settings from another TGrafBundle, and the other lets you copy from any descendant of TAttributeState.

The TGrafBundle constructors set the colors and drawing operation for the bundle. The drawing operation determines whether the bundle is fill, frame, or fill and frame. The drawing operation determines how the color gets used (for the fill, the frame, or the fill and frame). Each constructor described below has a default drawing operation. Drawing operations and how to change them are described under the heading "Drawing operations" on page 148.

TPaint is an abstract base class from which TColorPaint and TImagePatternPaint descend. TColorPaint lets you specify a single color, and TImagePatternPaint lets you specify a repeating image pattern using an image geometry.

Frame bundles

The constructor below creates a TGrafBundle by adopting an instance of TPaint and setting the drawing operation. By default, the drawing operation is set to kFrame to apply the TPaint to frames.

      TGrafBundle( TPaint* adoptPaint, 
                      EDrawOperation attribute = kFrame );
The constructor below creates a TGrafBundle by copying an instance of TColor and setting the drawing operation. By default, the drawing operation is set to kFrame to apply the TColor to the frame.

      TGrafBundle( const TColor& color, 
                      EDrawOperation attribute = kFrame );

Fill and Frame bundle

The constructor below
creates a TGrafBundle by adopting two instances of TPaint and setting the drawing operation. By default, the drawing operation is set to kFillAndFrame. The first TPaint is applied to fills, and the second TPaint is applied to frames.

      TGrafBundle( TPaint* adoptFillPaint, 
                      TPaint* adoptFramePaint, 
                      EDrawOperation attribute = kFillAndFrame )
The constructor below creates a TGrafBundle by adopting two instances of TColor and setting the drawing operation. By default, the drawing operation is set to kFillAndFrame. The first TColor is applied to fills, and the second TColor is applied to frames.

      TGrafBundle( const TColor& fillColor, 
                      const TColor& frameColor,
                      EDrawOperation attribute = kFillAndFrame );

Attribute state bundle

The parameter to this constructor is an instance created from any class that descends from
TAttributeState. All attribute bundles described in this chapter and TLinkedBundleState descend from TAttributeState. TLinkedBundleState provides hierarchical support for attribute bundles as described in Chapter 19.

Use this constructor to create an MGraphic using a special purpose bundle. See Chapter 2 for examples.

    TGrafBundle( const TAttributeState& anyAttributeState ); 

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker