Class: TFramedBorder

Declaration: Decoration.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TBorder

Inherited By:

TFramedBackground TRecessedBorder

Purpose:

TFramedBorder derives from TBorder and adds a frame around the outer edge and the inner edge of the inherited TBorder. TFramedBorder has two paint objects: the fill paint and the frame paint. The fill paint is used to draw the border, and the frame paint is used to draw the frame around the border. This class overrides TBorder's AdoptPaint function which, in addition to setting the fill paint, calculates the frame paint to match the fill paint and sets the frame paint.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive from TFramedBorder to add further to the border decoration.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TFramedBorder::~TFramedBorder

virtual ~ TFramedBorder ()

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: TFramedBorder::operator=

TFramedBorder & operator =(const TFramedBorder &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

Returns a 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: TFramedBorder::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: TFramedBorder::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 TInvalidVersionError if the object has detected an unsupportable version during the stream-in process.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::AdoptFramePaint

virtual void AdoptFramePaint (TPaint *)

Interface Category:

API.

Purpose:

Adopts the specified paint object as this border's frame paint, which is used to draw the frame around the border. To reset the frame paint back to its default value (calculated from the fill paint), specify NIL as the input parameter to this function. AdoptFramePaint deletes the previous frame paint object. Normally the frame paint is calculated from the fill paint in the function AdoptPaint. This function provides an override for that default.

Calling Context:

Called from SetFramePaint. You can also call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

You can also use SetFramePaint to set the frame paint. This member function is not used by the standard UI elements. The internal MGUIAttributeUser mixin is used instead to provide the various paints.

Member Function: TFramedBorder::CopyFramePaint

TPaint * CopyFramePaint () const

Interface Category:

API.

Purpose:

Creates a copy of the current frame paint.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the newly created copy of the frame paint, which can be NIL if no frame paint was set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::GetFramePaint

TPaint * GetFramePaint () const

Interface Category:

API.

Purpose:

Returns a pointer to the current frame paint object. The current frame paint object can be set with AdoptFramePaint or SetFramePaint.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the current frame paint object, which can be NIL if no frame paint was set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::SetFramePaint

virtual void SetFramePaint (const TPaint &)

Interface Category:

API.

Purpose:

Sets the frame paint used for drawing the frame around this border. SetFramePaint creates a copy of the input parameter, and then calls AdoptFramePaint to adopt the copy as its new frame paint. Normally the frame paint is calculated from the fill paint in the function AdoptPaint. This function provides an override for that default.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

You can also use AdoptFramePaint to set the frame paint. This member function is not used by the standard UI elements. The internal MGUIAttributeUser mixin is used instead to provide the various paints.

Member Function: TFramedBorder::OrphanFramePaint

virtual TPaint * OrphanFramePaint ()

Interface Category:

API.

Purpose:

Orphans the current frame paint object and resets the frame paint back to the default, which is derived from the current fill paint. This function does not delete the orphaned frame paint object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the orphaned paint object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::Draw

virtual void Draw (TGrafPort &) const

Interface Category:

API.

Purpose:

Draws this framed border. This function calls DrawBorder followed by DrawFrame.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TBorder's function of the same name.

Member Function: TFramedBorder::AdoptPaint

virtual void AdoptPaint (TPaint *)

Interface Category:

API.

Purpose:

Sets the fill paint to the specified paint object and then recalculates the frame paint from it. To reset the fill paint back to its default value, specify NIL as the input parameter to this function. AdoptPaint deletes the previous fill paint object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TBorder's function of the same name. This member function is not used by the standard UI elements. The internal MGUIAttributeUser mixin is used instead to provide the various paints.

Member Function: TFramedBorder::OrphanPaint

virtual TPaint * OrphanPaint ()

Interface Category:

API.

Purpose:

Orphans the framed border's fill paint. This function resets the fill paint to the default and then recalculates the frame paint from it. This function does not delete the orphaned fill paint object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the orphaned fill paint, which can be NIL if none was set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TBorder's function of the same name.

Member Function: TFramedBorder::DrawFrame

virtual void DrawFrame (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the frame. The frame is inset from the outside edge of the border and outset from the inside edge of the border. In other words, the frame is always drawn inside the region of the border itself. This way, clients always know that SetThickness sets the absolute size of the border regardless of further decoration. If the border thickness is zero, such that there is no inside edge, this function draws nothing.

Calling Context:

Called by Draw. Friend classes or classes deriving from TFramedBorder can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TFramedBorder::SetFrameWidth

virtual void SetFrameWidth (const GCoordinate width)

Interface Category:

API.

Purpose:

Sets the width of the pen used to draw the frame. By default, the frame is drawn with a 1-point pen.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::GetFrameWidth

GCoordinate GetFrameWidth () const

Interface Category:

API.

Purpose:

Returns the current width of the pen used to draw the frame.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the current width of the pen used to draw the frame.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFramedBorder::TFramedBorder

  1. TFramedBorder ()
  2. TFramedBorder (const TGRect & bounds, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  3. TFramedBorder (const TGRect & bounds, const TPaint & fill, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  4. TFramedBorder (const MGraphic & bounds, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  5. TFramedBorder (const MGraphic & bounds, const TPaint & fill, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  6. TFramedBorder (const TView & bounds, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  7. TFramedBorder (const TView & bounds, const TPaint & fill, GCoordinate thickness =kDefaultThickness, bool interior =kDefaultInteriorState)
  8. TFramedBorder (const TFramedBorder &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. 2-7. Creates a new framed border using the specified bounds, paint, and border thickness.
  3. Copy Constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. 2-7. Call this function directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

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.