Class: TRectControlState

Declaration: GUICompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TComponentAreaRectControlState

Purpose:

A simple control state that modifies the bounds of a rect. TRectControlState is an abstract base class.

Instantiation:

Allocate on the heap or the stack. Usually allocated on the heap.

Deriving Classes:

Derived classes must override the pure virtual functions GetRect and FinalSetRect. Derived classes also typically override IntermediateSetRect.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TRectControlState::TRectControlState

  1. TRectControlState ()
  2. TRectControlState (const TRectControlState &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and derived class constructors.
  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: TRectControlState::~TRectControlState

virtual ~ TRectControlState ()

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: TRectControlState::GetParent

TView * GetParent () const

Interface Category:

API.

Purpose:

Gets the parent view, or NIL if no parent view exists.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the parent view, or NIL if no parent view exists.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRectControlState::SetParent

void SetParent (TView *)

Interface Category:

API.

Purpose:

Sets the parent view. Pass NIL if no parent is desired. The parent view is used to calculate the coordinates of the rect.

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 isn't the best design. This class should probably not hold onto its parent view.

Member Function: TRectControlState::IsEnabled

virtual bool IsEnabled () const

Interface Category:

API.

Purpose:

Determines whether or not the control is enabled.

Calling Context:

Called by Control framework.

Parameters:

Return Value:

Returns true if the control is enabled. Returns true always.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRectControlState::IsSelected

virtual bool IsSelected () const

Interface Category:

API.

Purpose:

Determines whether or not the control is selected.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the control is selected. Returns true always.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRectControlState::GetRect

virtual TGRect GetRect () const

Interface Category:

API.

Purpose:

Returns the bounds of the rectangle which is the state of this control.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the bounds of the rectangle which is the state of this control.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TRectControlState.

Member Function: TRectControlState::IntermediateSetRect

virtual void IntermediateSetRect (const TGRect &)

Interface Category:

API.

Purpose:

Sets the bounds of the rectangle. Clients promise that FinalSetRect will eventually be called after a series of zero or more IntermediateSetRect calls. Because of this, implementing IntermediateSetRect is optional. It defaults to doing nothing.

Calling Context:

Called from the Begin and Increment phases of interactors.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Typically, derived classes will override this function.

Member Function: TRectControlState::FinalSetRect

virtual void FinalSetRect (const TGRect &)

Interface Category:

API.

Purpose:

Sets the bounds of the rectangle. Clients promise that FinalSetRect will eventually be called after a series of zero or more IntermediateSetRect calls.

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 is a pure virtual function and must be overridden by classes deriving from TRectControlState.

Member Function: TRectControlState::Update

virtual void Update (const TInterest &)

Interface Category:

API.

Purpose:

Override this function to receive notification.

Calling Context:

Called by the containing TBasicFrameView when notification is received from any of the interests returned by AddInterests.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

It's too bad that you don't get the notification itself.

Member Function: TRectControlState::AddInterests

virtual void AddInterests (TSetOf < TInterest > & set)

Interface Category:

API.

Purpose:

The control state supplies a set of interests. When notification is received from any of these interests, the Update function is called. This allows the instance to track changes in the state of some other object.

Calling Context:

Called by the containing frame view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRectControlState::operator=

TRectControlState & operator =(const TRectControlState &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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: TRectControlState::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: TRectControlState::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 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: TRectControlState::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns the hash value for this object. The hash value used to speed comparison.

Calling Context:

Called by collections when comparing objects.

Parameters:

Return Value:

Returns the hash value for this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Provided solely because this is an MCollectible derived class. Currently implemented to return 0, which is legal, but not a very good value.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.