Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TColorStyle
Inherited By:
TForegroundStyle
Purpose:
TBackgroundStyle, derived from TColorStyle, is used to draw background patterns behind characters. This is a common feature in Japanese word processors. This style can also be derived to draw frames around characters, also a common feature in Japanese word processors.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Derive classes to provide a more sophisticated implementation of background styling.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
virtual void Draw (TGrafPort * port, const TGArea & background, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles) const
Interface Category:
API.
Purpose:
Draws an image into the port at origin. The origin is at the intersection of the baseline and the left side of the image in horizontal text. In vertical text the origin is at the intersection of the baseline and the top of the image, for best results in vertical text the image should center around the origin. The ascent is the amount before the baseline, and the descent is the amount after the baseline. These values will usually be ignored by derived classes.
Calling Context:
Called to draw an image into the port at the origin.
Parameters:
- TGrafPort * port -The port in which to draw.
- const TGArea & background -The background area.
- const TStyleSet & characterStyles -The style of the characters drawn.
- const TStyleSet & paragraphStyles -The paragraph styles for the line.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual const TStyleName & GetName () const
Interface Category:
API.
Purpose:
Returns the style's internal name. This is not necessarily the class name. For example, there are related underlining styles that are each separate derived classes. However, because they are mutually exclusive, they share the same internal name.
Calling Context:
Called when the name associated with an object is needed; for example, when comparing objects.
Parameters:
Return Value:
The TToken for the associated name.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool operator ==(const TStyle & thatStyle) const
Interface Category:
API.
Purpose:
Equality operator.
Calling Context:
Called to compare two objects.
Parameters:
- const TStyle & thatStyle -The object to compare with this object.
Return Value:
Returns true if the objects are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual long Hash () const
Interface Category:
API.
Purpose:
Overrides inherited MCollectible function.
Calling Context:
Same as for base class.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TBackgroundStyle::GetUseGlyphAngles
virtual bool GetUseGlyphAngles () const
Interface Category:
API.
Purpose:
Queries whether the edges of the TArea used when drawing should be contoured to the slope of the glyphs that contain this style.
Calling Context:
Called when drawing.
Parameters:
Return Value:
Returns true if this field is set to true; the edges will be contoured.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TBackgroundStyle ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- TBackgroundStyle ()
- TBackgroundStyle (const TBackgroundStyle &)
- TBackgroundStyle (const TAttributeState & paint, bool useGlyphAngles =true)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
- Constructs a background style object with specified values.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call directly to construct a background style object with specified values.
Parameters:
- Takes no parameters.
- const TBackgroundStyle & -The object to copy.
- const TAttributeState & paint -The color to use when drawing.
- bool useGlyphAngles =true -Whether or not to contour the edges of the TArea used when drawing.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.