Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TActivatibleView
Inherited By:
TCanvasView
TDialogView
TDocumentComponentView
TTextControl
TTextView
Purpose:
TContentView is a base class that provides a concrete implementation of the activation protocol for applications. This is the class that developers should derive for most applications' content view.
Instantiation:
Always allocate on the heap. This class should always be derived to override at least one of the member functions DrawContents or GetOpaquelyDrawnArea.
Deriving Classes:
Derive classes from TContentView to provide the main view of your application or for other activatible views.
Never override the Activate, Deactivate, or IsActive member functions. Instead, provide implementations for the protected member functions HandleActivate and HandleDeactivate.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TContentView ()
- TContentView (const TGPoint & itsAllocatedAreaInLocalCoords, const TGPoint & itsLocationInContainerCoords =TGPoint :: kOrigin, bool visible =true)
- TContentView (const TGArea & viewArea, const TGPoint & itsLocationInContainerCoords =TGPoint :: kOrigin, bool visible =true)
- TContentView (const TContentView &)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a TContentView with the view area set to a rectangle of the specified size in local coordinates and location specified in parent coordinates.
- Creates a TContentView with the view area in local coordinates and location specified in the parent view's coordinates.
- Copy constructor. This constructor should not be used, since views do not support value semantics.
Calling Context:
- Called to create an object suitable for streaming into.
- Called to create an object with a rectangular area and specified location.
- Called to create an object with the specified area and location.
- Called to copy an object. Not used.
Parameters:
- Takes no parameters.
- const TGPoint & itsAllocatedAreaInLocalCoords -The size of the view in local coordinates.
- const TGPoint & itsLocationInContainerCoords =TGPoint :: kOrigin -The view's location in the parent view's coordinates.
- bool visible =true -If set to true, the content view is visible.
- const TGArea & viewArea -The view's area in local coordinates.
- const TGPoint & itsLocationInContainerCoords =TGPoint :: kOrigin -The view's location in the parent view's coordinates.
- bool visible =true -If set to true, the content view is visible.
- const TActivatibleView & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TContentView ()
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: TContentView::Activate
virtual bool Activate ()
Interface Category:
API.
Purpose:
Requests programmatic activation of this view and returns true if the activation was successful. Returns false if activation was not successful.
Calling Context:
Called to programmatically activate this view. Call this function directly.
Parameters:
Return Value:
Returns true if this view was successfully activated.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This member function should never be overridden.
Member Function: TContentView::IsActive
virtual bool IsActive () const
Interface Category:
API.
Purpose:
Determines if the view is active. Returns true if this view is active. Returns false if the view is not active.
Calling Context:
Called to determine if this view is currently active. Call this function directly.
Parameters:
Return Value:
Returns true if this view is active.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This member function should never be overridden.
Member Function: TContentView::operator=
TContentView & operator =(const TContentView &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object. This operator should not be used on this class, since views do not support value semantics.
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: TContentView::operator>>=
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called by ::Flatten to stream out data. Do not call this function directly on this class or derived classes except from an override. Use ::Flatten instead to preserve essential context information when this view is streamed.
Parameters:
- TStream & towhere -The destination stream.
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: TContentView::operator<<=
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called by Resurrect to recreate an object from a stream. Only call this function directly from an override; use ::Resurrect instead to preserve essential context information when this view is streamed.
Parameters:
- TStream & fromwhere -The source stream.
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: TContentView::HandleActivate
virtual void HandleActivate ()
Interface Category:
API.
Purpose:
Handles the activation of this view. The default implementation does nothing.
Calling Context:
Called asynchronously after this view has been activated. This function is not normally called directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes may provide an implementation for this member function to implement specific activation behavior.
Member Function: TContentView::HandleDeactivate
virtual void HandleDeactivate ()
Interface Category:
API.
Purpose:
Handles the deactivation of this view. The default implementation does nothing.
Calling Context:
Called asynchronously after this view has been deactivated. This function is not normally called directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes may provide an implementation for this member function to implement specific deactivation behavior.
Member Function: TContentView::CancelEventActivation
virtual void CancelEventActivation () const
Interface Category:
API.
Purpose:
Prevents the current mouse event from triggering activation of this view. This member function is only effective when called during the processing of a mouse event, especially a MouseDown.
Calling Context:
Called whenever a mouse event handler wants to handle activation programmatically. Call this function directly from within the scope of a mouse event handling override.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TContentView::IsActivatible
virtual bool IsActivatible () const
Interface Category:
API.
Purpose:
Determines if the view is activatible. Returns true if the view is activatible.
Calling Context:
Called to determine if the view is activatible whenever activation is requested programmatically or through event processing. This function may be called directly.
Parameters:
Return Value:
Returns true if the view is activatible.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TContentView::SetActivatible
virtual void SetActivatible (bool activatible =true)
Interface Category:
API.
Purpose:
Enables or disables the ability to activate the view.
Calling Context:
Called to enable or disable the ability to activate the view. Call this function directly.
Parameters:
- bool activatible =true -If set to true, the view will be made activatible.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TContentView::Deactivate
virtual void Deactivate ()
Interface Category:
API.
Purpose:
Deactivates the view.
Calling Context:
Called to programmatically deactivate the view. Call this function directly to deactivate this view.
Parameters:
Return Value:
None.
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.