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.
- TSimpleView (const TGPoint & size, const TGPoint & locationInParent =TGPoint :: kOrigin, bool visible =true)
- TSimpleView ()
Interface Category:
API.
Purpose:
- Creates a new TSimpleView with the specified size, location, and visibility. Only the size is required.
- Default constructor.
Calling Context:
- Called to create a view with the specified size at the specified location.
- 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:
- const TGPoint & size -The size of the new view, in its parent's coordinate system.
- const TGPoint & locationInParent =TGPoint :: kOrigin -The location of the new view relative to its parent coordinate system. Note that the notion of the location in parent is an abstract notion; the parent isn't specified and needn't exist when this constructor is called. The location refers to the relative position the view will have within its parent when it is adopted into its parent.
- bool visible =true -The flag that controls the semantic visibility of the new view. By default, the view is visible, and will be shown when adopted into a functioning view hierarchy (when the requests for the view hierarchy are processed).
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- TGArea & -The bounds of this view as returned by this function. Input value ignored.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TSimpleView::SetAllocatedArea
- virtual void SetAllocatedArea (const TGArea &)
- virtual void SetAllocatedArea (const TGRect &)
Interface Category:
API.
Purpose:
- Changes the allocated area of this view to the specified area. Also changes the view's bounds.
- Changes the allocated area of this view to the specified rectangle. Also changes the view's bounds.
Calling Context:
- Call from the same thread as the view to set/change the allocated area for this view.
- Call from the same thread as the view to set/change the allocated area for this view.
Parameters:
- const TGArea & -The new area for this view. Coordinates are relative to the view itself.
- const TGRect & -The new area for this view, as given by the rectangle. Coordinates are relative to the view itself.
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:
- const TGPoint & size -The new size (width and height) of this view. Coordinates are relative to the view itself (i.e. not relative to the parent's coordinate system).
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:
- const TGRect & rectToReveal -The rectangle, relative to the view's coordinate system, which should be made visible if at all possible. Visible means that it's scrolled so that it's not clipped by the boundaries of any of its ancestors, but does not pay attention to clipping induced by siblings or ancestral siblings.
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:
- TStream & fromWhere -The stream from which the object is streamed in.
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:
- TStream & toWhere -The stream to which the object is streamed out.
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.