Class: TCanvasTextGraphic

Declaration: CanvasText.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCanvasGraphic

Inherited By:

None.

Purpose:

A text canvas graphic. Note that this class was provided to demonstrate a simple way to add text functionality to GrafEdit. Other methods exist that would provide a more robust and usable solution. As such, this class is unlikely to be used in any manner other than how the sample program Mars uses it (see TCanvasTextGraphicCreationTool).

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Intended to be used as is, but can also be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::TCanvasTextGraphic

  1. TCanvasTextGraphic ()
  2. TCanvasTextGraphic (const TCanvasTextGraphic &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Constructor for creating new TCanvasTextGraphics
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::~TCanvasTextGraphic

virtual ~ TCanvasTextGraphic ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::SetText

virtual void SetText (const TText &, TGRect)

Interface Category:

API.

Purpose:

Sets the context of the TTextDisplay data member (fText).

Calling Context:

Called by TCanvasEditableTextView::HandleDeactivate.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::operator=

TCanvasTextGraphic & operator =(const TCanvasTextGraphic &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::HandleDraw

virtual void HandleDraw (TGrafPort &) const

Interface Category:

API.

Purpose:

Draws the graphic's untransformed geometry.

Calling Context:

Called by MCanvasGraphic::Draw, which links the graphic's transform and bundle to the port before calling HandleDraw.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::HandleGetBounds

virtual TGRect HandleGetBounds () const

Interface Category:

API.

Purpose:

Returns the bounding rectangle of the untransformed geometry.

Calling Context:

Called by MCanvasGraphic::GetGeometricBounds and MCanvasGraphic::GetLooseFitBounds, which apply the graphic's transform to the returned bounds and expand it as required by the graphic's bundle.

Parameters:

Return Value:

TGRect -The graphic's untransformed geometric bounds.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCanvasTextGraphic::HandleHit

virtual bool HandleHit (const TGPoint &) const

Interface Category:

API.

Purpose:

Detects the intersection of the point with the graphic's untransformed geometry.

Calling Context:

Called by MCanvasGraphic::Hit, which provides a point that has been untransformed by the graphic's transform.

Parameters:

Return Value:

Returns true if the point intersects ( hits ) the graphic's untransformed geometry.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not 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.