Class: TSimpleView

Declaration: SimpleView.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TView

Inherited By:

TPlayerControl TPlayerView TLabelView TBooleanControl TMediaView TMenu TMomentaryControl TScrollbar TScrollingView TSliderControl TStandardWindowBorder TTableView

Purpose:

TSimpleView derives from TView and implements a simple, initially rectangular view that draws a gray background. TSimpleView can be instantiated and used as a holder (and clipper) of other views. Developers typically do not use this TView derived class; it is primarily intended as a compatibility aid for CommonPoint system internal developers. Its only substantial difference from TView is that it is a concrete class: that is, it provides a definition of the GetBounds function. GetBounds is a pure virtual function in TView that returns the allocated area of the view. TSimpleView has the following features: (1) its bounds and its allocated area are the same; and (2) it draws a gray background.

Instantiation:

Always allocate on the heap. When used, it will be adopted, unless directly drawing during printing.

Deriving Classes:

Classes deriving from TSimpleView should override DrawContents to draw the view. Other functions that can be and often are overridden in classes deriving from TSimpleView are: RefreshContents, if refresh appearance is different from the DrawContents appearance; HandleAfterConnectionToViewRoot and HandleBeforeDisconnectionFromViewRoot, to determine when the view is part of a rooted view hierarchy; DistributePositionalEvent, to intercept positional event distribution; and GetOpaquelyDrawnArea, to indicate to the system that the view does not fill its entire allocated area opaquely, which can be used for views that are partially or fully transparent or translucent.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSimpleView::TSimpleView

  1. TSimpleView (const TGPoint & size, const TGPoint & locationInParent =TGPoint :: kOrigin, bool visible =true)
  2. TSimpleView ()

Interface Category:

API.

Purpose:

  1. Creates a new TSimpleView with the specified size, location, and visibility. Only the size is required.
  2. Default constructor.

Calling Context:

  1. Called to create a view with the specified size at the specified location.
  2. Called by the stream-in operators and by clients when the size and/or location for the new view is not known at creation time.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleView::~TSimpleView

virtual ~ TSimpleView ()

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:

No other considerations.

Member Function: TSimpleView::GetBounds

virtual void GetBounds (TGArea &) const

Interface Category:

API.

Purpose:

Returns the bounds of this view through the parameter. The bounds for TSimpleViews are the same as the allocated area.

Calling Context:

Call from the same thread as the view. The area parameter should be created, but its value will be ignored, and the returned area will be returned through the parameter.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleView::SetAllocatedArea

  1. virtual void SetAllocatedArea (const TGArea &)
  2. virtual void SetAllocatedArea (const TGRect &)

Interface Category:

API.

Purpose:

  1. Changes the allocated area of this view to the specified area. Also changes the view's bounds.
  2. Changes the allocated area of this view to the specified rectangle. Also changes the view's bounds.

Calling Context:

  1. Call from the same thread as the view to set/change the allocated area for this view.
  2. Call from the same thread as the view to set/change the allocated area for this view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleView::SetBounds

virtual void SetBounds (const TGPoint & size)

Interface Category:

API.

Purpose:

Sets the bounds and the allocated area for this view to those specified by size. The bounds extend from the view's origin to the point specified by size, which is interpreted as the width and height to use for the view.

Calling Context:

Called from the same thread as the view to set the bounds and allocated area.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleView::Reveal

virtual void Reveal (const TGRect & rectToReveal)

Interface Category:

API.

Purpose:

Causes the specified rectangular area of this view to become visible through adjusting the view's position.

Calling Context:

Called from the same thread as the view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is likely to change in future versions and its use should be avoided if at all possible.

Member Function: TSimpleView::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 no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleView::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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.