Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TLineLayoutStyle
Inherited By:
TMGraphicObjectStyle
Purpose:
Derived from TLineLayoutStyle, it mark the characters in the text which do not display through the standard font mechanism. Instead, when they get displayed, the TGraphicObjectStyle::Draw function is called. The Draw function can then draw the glyphs anyway it wants. The intended use for this style is to embed a picture or button in a line of text and have the picture behave as a character.
The paragraph and character style sets associated with the graphic object can be used by the object to display itself.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Derive classes to provide a specific implementation of the Draw member function.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
virtual void Draw (TGrafPort * port, const TGPoint & origin, GCoordinate ascent, GCoordinate descent, const UniChar & code, TSingleLineOrientation::ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles) const
Interface Category:
API.
Purpose:
Draws an image into the port at the 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 the best results with 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 ignore by derived classes.
Calling Context:
Called to draw an image into the port at the origin.
Parameters:
- TGrafPort * port -The grafport in which to draw.
- const TGPoint & origin -The point at which to draw.
- GCoordinate ascent -The amount before the baseline.
- GCoordinate descent -The amount after the baseline.
- const UniChar & code -The character to draw.
- TSingleLineOrientation::ELineOrientation direction -The line direction used in this drawing.
- const TStyleSet & characterStyles -The character styles used for this drawing.
- const TStyleSet & paragraphStyles -The paragraph styles used for this drawing.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Info (const UniChar & code, TSingleLineOrientation::ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles, GCoordinate & advance, GCoordinate & ascender, GCoordinate & descender) const
Interface Category:
API.
Purpose:
Calculates where a graphic will be displayed relative to other characters.
Calling Context:
Called when drawing to calculate where a graphic will be displayed relative to other characters.
Parameters:
- const UniChar & code -The character used in this computation.
- TSingleLineOrientation::ELineOrientation direction -The line direction used in this computation.
- const TStyleSet & characterStyles -The character styles used in this computation.
- const TStyleSet & paragraphStyles -The paragraph styles used in this computation.
- GCoordinate & advance -The width of the graphic in a horizontal line. The height of the graphic in a vertical line.
- GCoordinate & ascender -The amount of the graphic that displays above the origin in a horizontal line. The amount of the graphic that displays to the right of the origin in a vertical line.
- GCoordinate & descender -The amount of the graphic that displays below the origin in a horizontal line. The amount of the graphic that displays to the left of the origin in a vertical line.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool IsPropagatingStyle () const
Interface Category:
API.
Purpose:
Queries whether the style propagates.
Calling Context:
Called to determine if the style propagates.
Parameters:
Return Value:
Returns true if this style propagates.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- TGraphicObjectStyle (const TGraphicObjectStyle &)
- TGraphicObjectStyle ()
Interface Category:
API.
Purpose:
- Copy constructor.
- Default constructor.
Calling Context:
- Called to copy an object.
- Called by the stream-in operators.
Parameters:
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.
virtual ~ TGraphicObjectStyle ()
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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.