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.
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.
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.
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.
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.