#include <views.h>
Inheritance diagram for TScroller::
Public Methods | |
TScroller (const TRect &bounds, TScrollBar *aHScrollBar, TScrollBar *aVScrollBar) | |
virtual void | changeBounds (const TRect &bounds) |
virtual TPalette& | getPalette () const |
virtual void | handleEvent (TEvent &event) |
virtual void | scrollDraw () |
void | scrollTo (int x, int y) |
void | setLimit (int x, int y) |
virtual void | setState (ushort aState, Boolean enable) |
void | checkDraw () |
virtual void | shutDown () |
Static Public Methods | |
TStreamable* | build () |
Public Attributes | |
TPoint | delta |
Static Public Attributes | |
const char* const | name |
Protected Methods | |
TScroller (StreamableInit) | |
virtual void | write (opstream &os) |
virtual void* | read (ipstream &is) |
Protected Attributes | |
uchar | drawLock |
Boolean | drawFlag |
TScrollBar* | hScrollBar |
TScrollBar* | vScrollBar |
TPoint | limit |
The scroller provides an offset from which the TView::draw() method fills the visible region. All methods needed to provide both scroll bar and keyboard scrolling are built into TScroller.
The basic scrolling view provides a useful starting point for scrolling views such as text views.
Definition at line 2379 of file views.h.
|
Creates and initializes a TScroller object with the given size and scroll bars. Calls TView constructor to set the view's size. `aHScrollBar' should be 0 if you do not want a horizontal scroll bar; `aVScrollBar' should be 0 if you do not want a vertical scroll bar. |
|
Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit. |
|
Called to create an object in certain stream-reading situations. Reimplemented from TView. Reimplemented in TOutlineViewer, and TOutline. |
|
Changes the scroller's size by calling TView::setbounds(). If necessary, the scroller and scroll bars are then redrawn by calling setLimit() and drawView(). Reimplemented from TView. Reimplemented in THelpViewer. |
|
If drawLock is zero and drawFlag is True, drawFlag is set False and drawView() is called. If drawLock is non-zero or drawFlag is False, checkDraw() does nothing. Methods scrollTo() and setLimit() each call checkDraw() so that drawView() is only called if needed. |
|
Returns the default scroller palette string. Reimplemented from TView. Reimplemented in THelpViewer, and TOutlineViewer. |
|
Handles most events by calling TView::handleEvent(). Broadcast events such as cmScrollBarChanged from either hScrollBar or vScrollBar result in a call to scrollDraw(). Reimplemented from TView. Reimplemented in THelpViewer, and TOutlineViewer. |
|
Reads from the input stream `is'. Reimplemented from TView. Reimplemented in TOutlineViewer, and TOutline. |
|
Checks to see if delta matches the current positions of the scroll bars. If not, delta is set to the correct value and drawView() is called to redraw the scroller. |
|
Sets the scroll bars to (x,y) by calling hScrollBar->setValue(x) and vScrollBar->setValue(y) and redraws the view by calling drawView().
|
|
Sets the limit data member and redraws the scrollbars and scroller if necessary. |
|
This member function is called whenever the scroller's state changes. Calls TView::setState() to set or clear the state flags in `aState'. If the new state is sfSelected and sfActive, setState() displays the scroll bars; otherwise, they are hidden. Reimplemented from TView. Reimplemented in TOutlineViewer. |
|
Used internally by TObject::destroy() to ensure correct destruction of derived and related objects. shutDown() is overridden in many classes to ensure the proper setting of related data members when destroy() is called. Reimplemented from TView. |
|
Writes to the output stream `os'. Reimplemented from TView. Reimplemented in TOutlineViewer, and TOutline. |
|
Holds the x (horizontal) and y (vertical) components of the scroller's position relative to the virtual view being scrolled. Automatic scrolling is achieved by changing either or both of these components in response to scroll bar events that change the value data member(s). Manual scrolling changes delta, triggers changes in the scroll bar TScrollBar::value data members, and leads to updating of the scroll bar indicators. |
|
Set True if the scroller has to be redrawn. |
|
A semaphore used to control the redrawing of scrollers. |
|
Points to the horizontal scroll bar object associated with the scroller. If there is no such scroll bar, hScrollBar is 0. |
|
Data members limit.x and limit.y are the maximum allowed values for delta.x and delta.y data members.
|
|
Undocumented. Reimplemented from TView. Reimplemented in TOutlineViewer, and TOutline. |
|
Points to the vertical scroll bar object associated with the scroller. If there is no such scroll bar, vScrollBar is 0. |