Class: TCloseBox

Declaration: CloseBox.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMomentaryControl

Inherited By:

None.

Purpose:

TCloseBox derives from TMomentaryControl and implements a control commonly used to close and open windows. This class implements the CommonPoint standard appearance and behavior of a close box and is used by TStandardWindow. TCloseBox indirectly inherits from VViewInitialize and must implement certain initializations where noted in the member function descriptions.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive from this class if you want to change the appearance of the close box. Override DrawContents.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TCloseBox::TCloseBox

  1. TCloseBox ()
  2. TCloseBox (MMomentaryControlState * delegate, bool windowControl =true)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a new close box whose control state is the MMomentaryControlState object provided.

Calling Context:

  1. Called by the stream-in operators.
  2. You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Views will not draw until they are connected into a rooted view hierarchy. When implementing constructors in a derived class' constructor, be sure to call CheckForInitialize as the last thing the constructor does.

Member Function: TCloseBox::~TCloseBox

virtual ~ TCloseBox ()

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:

When implementing a derived class's destructor, be sure to call CheckForFinalize as the first thing the destructor does.

Member Function: TCloseBox::SetColor

virtual void SetColor (const TColor &)

Interface Category:

API.

Purpose:

SetColor establishes the color used to draw the close box. The default color is TStandardWindow::kDefaultWindowColor.

Calling Context:

You can 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: TCloseBox::GetColor

void GetColor (TColor &) const

Interface Category:

API.

Purpose:

Returns the current color used to draw the close box.

Calling Context:

You can 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: TCloseBox::GetBounds

virtual void GetBounds (TGArea &) const

Interface Category:

API.

Purpose:

Returns the extent of the close box (not just the area allocated to it by its parent). By default, GetBounds simply calls the TView function GetAllocatedArea.

Calling Context:

You can 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: TCloseBox::TransformBy

virtual void TransformBy (const TGrafMatrix &)

Interface Category:

API.

Purpose:

Transforms the close box by the specified TGrafMatrix using concatenation. Overrides the function of the same name of the "grandparent" class TSimpleView.

Calling Context:

Used internally by the window. Normally you would not call this function; use MoveWindowTo or MoveWindowBy instead.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCloseBox::operator=

TCloseBox & operator =(const TCloseBox &)

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

virtual TStream & operator >>=(TStream & towhere) 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: TCloseBox::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

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 a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCloseBox::NeedsClipping

virtual bool NeedsClipping ()

Interface Category:

API.

Purpose:

Override of a View system member function. Determines if the drawing needs to be clipped to fit into the allocated area.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

Returns true if drawing needs to be clipped to the allocated area.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCloseBox::DrawContents

virtual void DrawContents (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the close box. Classes deriving from TCloseBox should override this function to implement a close box with a different appearance.

Calling Context:

Friend classes or classes deriving from TCloseBox 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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.