[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LScroller



Overview:

LScroller is a PowerPlant class that is used for scrolling views. Scroller views implement all the functionality of scroll bars, including creation, resizing, moving, hiding, showing, enabling and other operations. Sometimes you will see scrolling views referred to simply as "Scrollers" in the PowerPlant documentation.

The only functional difference between LActiveScroller and LScroller is that LActiveScroller supports dynamic scrolling of the view

Methods :

The methods in this class are:

 

LScroller()  
~LScroller()  
ActivateSelf()  
AdjustScrollBars()  
DeactivateSelf()  
DrawSelf()  
ExpandSubPane()  
FinishCreateSelf()  
HasHorizontalScrollBar()  
HasVerticalScrollBar()  
HorizSBarAction()  
HorizScroll()  
InstallView()  
ListenToMessage()  
MakeScrollBars()  
ResizeFrameBy()  
SubImageChanged()  
VertSBarAction()  
VertScroll()  
 

Data Members:

The data members in this class are:

 

mScrollingView  
mVerticalBar  
mHorizontalBar  
mScrollingViewID  

Operation:

The most important feature of a Scroller view is that it has only one subpane, which is a view. The subview may contain an arbitrary number of panes and views. The net effect is that the Scroller view may contain any number of panes of any type.

Source files:

(Pane Classes)

LScroller.h

LScroller.cp

Ancestors:

LListener

LPane

LView

LScroller()

Purpose:

The constructor creates objects from the passed-in parameters.

Access:

Public

Prototype:

LScroller();

LScroller( const LScroller &inOriginal );

LScroller( const SPaneInfo &inPaneInfo,
const SViewInfo &inViewInfo,
SInt16 inHorizBarLeftIndent,
SInt16 inHorizBarRightIndent,
SInt16 inVertBarTopIndent,
SInt16 inVertBarBottomIndent,
LView *inScrollingView );

LScroller( LStream *inStream );
Parameters:

These constructors have the following parameters:

 

const   LScroller&  
inOriginal  
A reference to the LScroller object you want to copy.  
const   SPaneInfo&  
inPaneInfo  
A reference to the SPaneInfo object that is the super view.  
const   SViewInfo&  
inViewInfo  
A reference to the SViewInfo object that contains information about the SuperView.  
SInt16  
inHorizBarLeftIndent  
The indentation to use on the left side for the horizontal scrolling. A good initial value for this parameter is 15.  
SInt16  
inHorizBar-RightIndent  
The indentation to use on the right side for the horizontal scrolling. A good initial value for this parameter is 15.  
SInt16  
inVertBarTop-Indent  
The indentation to use on the top for the vertical scrolling. A good initial value for this parameter is 15.  
SInt16  
inVertBarBottomIndent  
The indentation to use on the bottom for the vertical scrolling. A good initial value for this parameter is 15.  
LView  
inScrollingView  
A pointer to the view that corresponds to this Scroller.  
LStream*  
inStream  
A pointer to a stream object that contains the information to create the LScroller object.  

~LScroller()

Purpose:

The destructor destroys the object.

Access:

Virtual, Public

Prototype:

virtual ~LScroller();

ActivateSelf()

Purpose:

This method activates the Scroller, and show scroll bars that were hidden when deactivated. This method is an override of ActivateSelf() in the LPane class.

AdjustScrollBars()

Purpose:

This method adjusts the scroll bars (value, min, and max) according to the current state of the Scroller and ScrollingView.

Access:

Virtual, Public

Prototype:

virtual void AdjustScrollBars();
Parameters:

None

Return:

None

DeactivateSelf()

Purpose:

This method deactivates the Scroller. According to Mac OS Human Interface Guidelines, scroll bars in inactive windows are hidden. This method is an override of DeactivateSelf() in the LPane class.

DrawSelf()

Purpose:

This method draws a Scroller. This method is an override of DrawSelf() in the LPane class.

ExpandSubPane()

Purpose:

Expand a SubPane, which should be the Scroller's ScrollingView, to fill the interior of a Scroller. This method is an override of ExpandSubPane() in the LView class.

FinishCreateSelf()

Purpose:

Finish creation of a Scroller by installing its ScrollingView. This method is an override of FinishCreateSelf() in the LPane class.

HasHorizontalScrollBar()

Purpose:

This method returns a Boolean indicating whether mHorizontalBar is nil or not.

Access:

Inline, Public

Prototype:

Boolean HasHorizontalScrollBar();
Parameters:

None

Return:

Boolean indicating mHorizontalBar != nil

HasVerticalScrollBar()

Purpose:

This method returns a Boolean indicating whether mVerticalBar is nil or not.

Access:

Inline, Public

Prototype:

Boolean HasVerticalScrollBar();
Parameters:

None

Return:

Boolean indicating mVerticalBar != nil

HorizSBarAction()

Purpose:

Mac OS Toolbox callback function for the action to take while tracking a mouse click in a horizontal scroll bar.

Access:

Static, Protected

Prototype:

static pascal void HorizSBarAction(
ControlHandle inMacControl,
SInt16 inPart);
Parameters:

This method has the following parameters:

 

ControlHandle  
inMacControl  
This is the handle to the Mac OS control.  
SInt16  
inPart  
This is an enumeration, like kControl-UpButtonPart. See the Mac OS system header file named Controls.h for a list of these.  

Return:

None

HorizScroll()

Purpose:

This method is called to scroll horizontally while clicking and holding inside the horizontal scroll bar.

Access:

Virtual, Public

Prototype:

virtual void HorizScroll( SInt16 inPart );
Parameters:

This method has the following parameter:

 

SInt16  
inPart  
This is an enumeration, like kControl-UpButtonPart. See the Mac OS system header file named Controls.h for a list of these.  

Return:

None

InstallView()

Purpose:

This method installs a Scrolling View within this Scroller.

Access:

Virtual, Public

Prototype:

virtual void InstallView( LView *inScrollingView 
);
Parameters:

This method has the following parameter:

 

LView*  
inScrollingView  
This is a pointer to the scrolling view to install in the scroller.  

Return:

None

ListenToMessage()

Purpose:

This method responds to messages from Broadcasters. The ScrollBars of a Scroller broadcast a message after the user drags the thumb. This method is an override of the pure virtual method ListenToMessage() in the LListener class.

Access:

Virtual, Public

Prototype:

virtual void ListenToMessage( MessageT inMessage,
void *ioParam);
Parameters:

This method has the following parameters:

 

MessageT  
inMessage  
This is the message that is broadcast from the framework. If the message is msg_ThumbDragged then processing is required.  
void*  
ioParam  
This is a data block pointer that accompanies the message.  

Return:

None

Remarks:

You must supply an implementation for this method since it is a pure virtual in the base class.

MakeScrollBars()

Purpose:

Create standard Mac OS control objects for the horizontal and/or vertical scroll bars of a Scroller.

Access:

Private

Prototype:

void MakeScrollBars( SInt16 inHorizBarLeftIndent,
SInt16 inHorizBarRightIndent,
SInt16 inVertBarTopIndent,
SInt16 inVertBarBottomIndent );
Parameters:

This method has the following parameters:

 

SInt16  
inHorizBarLeftIndent  
The indentation to use on the left side for the horizontal scrolling. A good initial value for this parameter is 15.  
SInt16  
inHorizBar-RightIndent  
The indentation to use on the right side for the horizontal scrolling. A good initial value for this parameter is 15.  
SInt16  
inVertBarTopIndent  
The indentation to use on the top for the vertical scrolling. A good initial value for this parameter is 15.  
SInt16  
inVertBar-BottomIndent  
The indentation to use on the bottom for the vertical scrolling. A good initial value for this parameter is 15.  

Return:

None

ResizeFrameBy()

Purpose:

Change the Frame size by the specified amounts. This method is an override of ResizeFrameBy() in the LPane class.

SubImageChanged()

Purpose:

Adjust state when the Image of the ScrollingView changes. Scroll bar settings depend on the ScrollingView Image, so they must be adjusted to match the current state. This method is an override of SubImageChanged() in the LView class.

Access:

Virtual, Public

Prototype:

virtual void SubImageChanged( LView *inSubView );
Parameters:

This method has the following parameter:

 

LView*  
inSubView  
This is a pointer to the scrolling view to install in the scroller.  

Return:

None

VertSBarAction()

Purpose:

Mac OS Toolbox callback function for the action to take while tracking a mouse click in a vertical scroll bar.

Access:

Static, Protected

Prototype:

static pascal void VertSBarAction(
ControlHandle inMacControl,
SInt16 inPart);
Parameters:

This method has the following parameters:

 

ControlHandle  
inMacControl  
This is the handle to the Mac OS control.  
SInt16  
inPart  
This is an enumeration, like kControlUpButtonPart. See the Mac OS system header file named Controls.h for a list of these.  

Return:

None

VertScroll()

Purpose:

This method is called to scroll vertically while clicking and holding inside the vertical scroll bar.

Access:

Virtual, Public

Prototype:

virtual void VertScroll( SInt16 inPart );
Parameters:

This method has the following parameter:

 

SInt16  
inPart  
This is an enumeration, like kControlUpButtonPart. See the Mac OS system header file named Controls.h for a list of these.  

Return:

None

mScrollingView

Purpose:

This data member is a pointer to the ScrollingView.

Access:

Protected

Prototype:

LView *mScrollingView;

mVerticalBar

Purpose:

This data member is a pointer to the standard control that is a vertical scroll bar.

Access:

Protected

Prototype:

LStdControl *mVerticalBar;

mHorizontalBar

Purpose:

This data member is a pointer to the standard control that is a horizontal scroll bar.

Access:

Protected

Prototype:

LStdControl *mHorizontalBar;

mScrollingViewID

Purpose:

This data member is the resource ID of the ScrollingView.

Access:

Protected

Prototype:

PaneIDT mScrollingViewID;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000