Class: TScrollingView

Declaration: ScrollingView.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSimpleView, MActionTarget, MScrollActionHandler

Inherited By:

TScrollingList

Purpose:

TScrollingView implements a container view that associates one or two TScrollBar objects with a client provided content view. This allows the user to manipulate the scroll bars to scroll the visible area of the content view within the scrolling view.

Instantiation:

Allocate on the heap or on the stack.

Deriving Classes:

You may derive classes from TScrollingView.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TScrollingView::TScrollingView

  1. TScrollingView ()
  2. TScrollingView (EScrollbarUsage usage)
  3. TScrollingView (const TScrollingView &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates an object with the specified scroll bar usage.
  3. Copy constructor.

Calling Context:

  1. Called to create a TScrollingView suitable for streaming into.
  2. Called to create an object with the specified scroll bar usage.
  3. 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: TScrollingView::~TScrollingView

virtual ~ TScrollingView ()

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: TScrollingView::operator=

TScrollingView & operator =(const TScrollingView &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::AdoptViewToScroll

virtual void AdoptViewToScroll (TView * viewToAdopt)

Interface Category:

API.

Purpose:

Adopts the specified view as the content view to scroll.

Calling Context:

Call this function directly to adopt a view to scroll.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::OrphanViewToScroll

virtual TView * OrphanViewToScroll ()

Interface Category:

API.

Purpose:

Orphans the currently adopted view.

Calling Context:

Call this function directly to orphan the currently adopted view.

Parameters:

Return Value:

A pointer to the orphaned view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::AdoptScrollCoordinator

virtual void AdoptScrollCoordinator (TScrollCoordinator * coordinator)

Interface Category:

API.

Purpose:

Deletes any previously adopted scroll coordinator and adopts the specified scroll coordinator.

Calling Context:

Call this function directly to adopt a new scroll coordinator.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::OrphanScrollCoordinator

virtual TScrollCoordinator * OrphanScrollCoordinator ()

Interface Category:

API.

Purpose:

Orphans the currently adopted scroll coordinator.

Calling Context:

Call this function directly to orphan the currently adopted scroll coordinator.

Parameters:

Return Value:

A pointer to the orphaned scroll coordinator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::SetScrollbarUsage

virtual void SetScrollbarUsage (EScrollbarUsage usage)

Interface Category:

API.

Purpose:

Sets the scroll bar usage for this view.

Calling Context:

Call this function directly to set the scroll bar usage for this view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::GetScrollbarUsage

virtual EScrollbarUsage GetScrollbarUsage () const

Interface Category:

API.

Purpose:

Returns the current scroll bar usage for this view.

Calling Context:

Call this function directly to obtain the current scroll bar usage for this view.

Parameters:

Return Value:

An enum representing the current scroll bar usage for this view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::AllowPartialEndPage

virtual void AllowPartialEndPage (bool allowed, EOrientation orientation)

Interface Category:

API.

Purpose:

Enables or disables the displaying of a partial end page for the specified scrolling orientation.

Calling Context:

Call this function directly to enable or disable the displaying of a partial end page for the vertical or horizontal orientation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::IsPartialEndPageAllowed

virtual bool IsPartialEndPageAllowed (EOrientation orientation) const

Interface Category:

API.

Purpose:

Returns true if the displaying of a partial end page is allowed for the specified scrolling orientation. False is returned if partial end page displaying is not allowed.

Calling Context:

Call this function directly to determine if the displaying of a partial end page is allowed for a specific orientation.

Parameters:

Return Value:

Returns true if the displaying of a partial end page is allowed for the specified scrolling orientation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::SetScrollbarTrackingEnabled

virtual void SetScrollbarTrackingEnabled (bool shouldTrack)

Interface Category:

API.

Purpose:

Enables or disables scroll bar tracking.

Calling Context:

Call this function directly to enable or disable scroll bar tracking.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::IsScrollbarTrackingEnabled

virtual bool IsScrollbarTrackingEnabled () const

Interface Category:

API.

Purpose:

Returns true if scroll bar tracking is enabled, false if it is disabled.

Calling Context:

Call this function directly determine if scroll bar tracking is enabled or disabled.

Parameters:

Return Value:

Returns true if scroll bar tracking is enabled, false if it is disabled.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::DrawContents

virtual void DrawContents (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the contents of this view to the specified port.

Calling Context:

Called by the View system to draw the contents of this view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::SetAllocatedAreaInParent

virtual void SetAllocatedAreaInParent (const TGArea &)

Interface Category:

API.

Purpose:

Sets the area allocated to this view within the parent view.

Calling Context:

Called to set the area allocated to this view within the parent view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Note that the proper way to catch area changes is to override TView::HandleAllocatedAreaChanged.

Member Function: TScrollingView::SetAllocatedArea

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

Interface Category:

API.

Purpose:

Sets the allocated area for this view.

Calling Context:

Called to set the allocated area for this view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Note that the proper way to catch area changes is to override TView::HandleAllocatedAreaChanged.

Member Function: TScrollingView::HandleScrolled

virtual void HandleScrolled ()

Interface Category:

API.

Purpose:

This function is called for each scroll of the content view. The default implementation does nothing. Deriving classes can override to react to each scroll. For example, an override might adjust a ruler contained within a nearby scrolling view for each scroll.

Calling Context:

Called for each scroll of the content view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Deriving classes should implement this member function.

Member Function: TScrollingView::AdoptClipBackgroundBundle

virtual void AdoptClipBackgroundBundle (TGrafBundle * bundle)

Interface Category:

API.

Purpose:

Draws the specified bundle into the exposed clip area if the content view is smaller than the clipping rectangle.

Calling Context:

Called to draw the specified bundle if the content view is smaller than the clipping rectangle.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::VerticalUnitScroll

virtual void VerticalUnitScroll (signed long lines)

Interface Category:

API.

Purpose:

Scrolls the view vertically by the number of lines specified.

Calling Context:

Call this function directly to scroll the view vertically.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::HorizontalUnitScroll

virtual void HorizontalUnitScroll (signed long units)

Interface Category:

API.

Purpose:

Scrolls the view horizontally by the number of units specified.

Calling Context:

Call this function directly to scroll the view horizontally.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::VerticalPageScroll

virtual void VerticalPageScroll (signed long pages)

Interface Category:

API.

Purpose:

Scrolls the view vertically by the number of pages specified.

Calling Context:

Call this function directly to scroll the view vertically.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::HorizontalPageScroll

virtual void HorizontalPageScroll (signed long pages)

Interface Category:

API.

Purpose:

Scrolls the view horizontally by the number of pages specified.

Calling Context:

Call this function directly to scroll the view horizontally.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::HomeScroll

virtual void HomeScroll ()

Interface Category:

API.

Purpose:

Scrolls the view to the home position.

Calling Context:

Call this function directly to scroll this view to the home position.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::EndScroll

virtual void EndScroll ()

Interface Category:

API.

Purpose:

Scrolls the view to the end position.

Calling Context:

Call this function directly to scroll this view to the end position.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::PositionScrolledViewPoint

virtual void PositionScrolledViewPoint (const TGPoint & scrolledViewLocalPoint, const TGPoint & clipLocalPoint)

Interface Category:

API.

Purpose:

Scrolls the view such that the points scrolledViewLocalPoint and clipLocalPoint are aligned.

Calling Context:

Call this function directly to scroll the view such that scrolledViewLocalPoint and clipLocalPoint are aligned.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::MakeScrolledViewRectVisible

virtual void MakeScrolledViewRectVisible (const TGRect & criticalRect, const TGRect & proximityRect =TGRect :: kInfiniteRect)

Interface Category:

API.

Purpose:

Attempts to make proximityRect visible if it is not the infinite rectangle and it contains the criticalRect. If any of these conditions are not met or if the attempt fails, then an attempt is made to make the critical rect visible. If neither rectangle can be made visible, then this function will align the closest corresponding corners of the criticalRect and the clipping rectangle, using the PositionScrolledViewPoint member function.

Calling Context:

Call this function directly when an user types or selects beyond the bounds of a clipped area.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::GetClipRectSize

virtual TGPoint GetClipRectSize () const

Interface Category:

API.

Purpose:

Returns the size of the clipping rectangle.

Calling Context:

Call this function directly to obtain the size of the clipping rectangle.

Parameters:

Return Value:

Returns the size of the clipping rectangle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::GetClipRectOverScrolledView

virtual TGRect GetClipRectOverScrolledView () const

Interface Category:

API.

Purpose:

Returns the clipping rectangle in scrolled view coordinates.

Calling Context:

Call this function directly to obtain the clipping rectangle in scrolled view coordinates.

Parameters:

Return Value:

Returns the clipping rectangle in scrolled view coordinates.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::Layout

virtual void Layout ()

Interface Category:

API.

Purpose:

Sets up the layout for this scrolling view's scroll bars and the clipping view.

Calling Context:

Should not be called by the client.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::Constrain

virtual void Constrain ()

Interface Category:

API.

Purpose:

Normalizes the slider's float constraints based on TScrollbar's float constraints and size.

Calling Context:

Should not be called by the client.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::CreateScrollbar

virtual TScrollbar * CreateScrollbar (EOrientation)

Interface Category:

API.

Purpose:

Creates a scroll bar with the specified orientation.

Calling Context:

Called to create a scroll bar for this view.

Parameters:

Return Value:

A pointer to the scroll bar created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Deriving classes may override this member function to cause different scroll bars to be used in a TScrollingView.

Member Function: TScrollingView::ApplyTransformToScrollingView

virtual void ApplyTransformToScrollingView (TGrafMatrix & matrix)

Interface Category:

API.

Purpose:

Applies the specified transformation to the content view being scrolled. The scroll bars will adjust to any changes in the content view area size.

Calling Context:

Called to apply a transformation to this view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::AdjustTranslateMatrix

virtual void AdjustTranslateMatrix (TGrafMatrix & matrix)

Interface Category:

API.

Purpose:

Adjusts a translation before it is applied to the content view to ensure that the translation does not move the content view to a position that would render the scroll bars invalid. For example, the top of the content view should not appear below the top of the clipping rectangle.

Calling Context:

Should not be called by the client.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::ScrollToRevealScrolledViewRect

virtual void ScrollToRevealScrolledViewRect (const TGRect & scrolledViewRect)

Interface Category:

API.

Purpose:

Used by TScrollingView to implement PositionScrolledViewPoint.

Calling Context:

Should not be called by the client.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::NeedsClipping

virtual bool NeedsClipping ()

Interface Category:

API.

Purpose:

Returns true if this view needs clipping, returns false if not. Because TScrollingView and its children do not draw outside their bounds, NeedsClipping is overridden to return false.

Calling Context:

Called by the View system to determine if this view needs to be clipped.

Parameters:

Return Value:

Returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScrollingView::GetOpaquelyDrawnArea

virtual void GetOpaquelyDrawnArea (TGArea & opaqueArea)

Interface Category:

API.

Purpose:

This is a TView override that is used to indicate how much of the allocated area of the view (in this case, the TScrollingView) draws opaquely. The TView default behavior is to specify that the entire allocated area is drawn opaquely. A TScrollingView object is a view, but it doesn't actually draw anything in its area; it's transparent (the drawing is actually done by the content view that is being scroll). This function thus returns an empty area to indicate that none of the TScrollingView area is drawn opaquely.

Calling Context:

Called by the view system to determine the area that the view actually draws, and for optimizing damage generation and repair.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TView function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.