![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The scroll bar is used when a document has a larger content than may be made visible. More...
#include <FXScrollBar.h>
Public Types | |
| enum | { ID_AUTOSCROLL = FXWindow::ID_LAST, ID_TIMEWHEEL, ID_LAST } |
Public Member Functions | |
| long | onPaint (FXObject *, FXSelector, void *) |
| long | onMotion (FXObject *, FXSelector, void *) |
| long | onMouseWheel (FXObject *, FXSelector, void *) |
| long | onLeftBtnPress (FXObject *, FXSelector, void *) |
| long | onLeftBtnRelease (FXObject *, FXSelector, void *) |
| long | onMiddleBtnPress (FXObject *, FXSelector, void *) |
| long | onMiddleBtnRelease (FXObject *, FXSelector, void *) |
| long | onRightBtnPress (FXObject *, FXSelector, void *) |
| long | onRightBtnRelease (FXObject *, FXSelector, void *) |
| long | onUngrabbed (FXObject *, FXSelector, void *) |
| long | onTimeWheel (FXObject *, FXSelector, void *) |
| long | onAutoScroll (FXObject *, FXSelector, void *) |
| long | onCmdSetValue (FXObject *, FXSelector, void *) |
| long | onCmdSetIntValue (FXObject *, FXSelector, void *) |
| long | onCmdGetIntValue (FXObject *, FXSelector, void *) |
| long | onCmdSetLongValue (FXObject *, FXSelector, void *) |
| long | onCmdGetLongValue (FXObject *, FXSelector, void *) |
| long | onCmdSetIntRange (FXObject *, FXSelector, void *) |
| long | onCmdGetIntRange (FXObject *, FXSelector, void *) |
| FXScrollBar (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=SCROLLBAR_VERTICAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0) | |
| Construct scroll bar. | |
| virtual FXint | getDefaultWidth () |
| Return default width. | |
| virtual FXint | getDefaultHeight () |
| Return default height. | |
| virtual void | layout () |
| Perform layout. | |
| void | setRange (FXint r, FXbool notify=false) |
| Set content size range. | |
| FXint | getRange () const |
| Return content size range. | |
| void | setPage (FXint p, FXbool notify=false) |
| Set the viewable page size. | |
| FXint | getPage () const |
| Return viewable page size. | |
| void | setPosition (FXint p, FXbool notify=false) |
| Change scroll position. | |
| FXint | getPosition () const |
| Return current scroll position. | |
| void | setLine (FXint l) |
| Set scoll increment for line. | |
| FXint | getLine () const |
| Return line increment. | |
| void | setHiliteColor (FXColor clr) |
| Change highlight color. | |
| FXColor | getHiliteColor () const |
| Return highlight color. | |
| void | setShadowColor (FXColor clr) |
| Change the shadow color. | |
| FXColor | getShadowColor () const |
| Return the shadow color. | |
| void | setBorderColor (FXColor clr) |
| Change the border color. | |
| FXColor | getBorderColor () const |
| Return the border color. | |
| void | setArrowColor (FXColor clr) |
| Change the arrow color. | |
| FXColor | getArrowColor () const |
| Return the arrow color. | |
| void | setScrollBarStyle (FXuint style) |
| Change the scrollbar style. | |
| FXuint | getScrollBarStyle () const |
| Return the scrollbar style. | |
| void | setBarSize (FXint size) |
| Change the bar size. | |
| FXint | getBarSize () const |
| Return the bar size. | |
| virtual void | save (FXStream &store) const |
| Save to stream. | |
| virtual void | load (FXStream &store) |
| Load from stream. | |
| virtual | ~FXScrollBar () |
| Destructor. | |
Protected Types | |
| enum | { MODE_NONE, MODE_INC, MODE_DEC, MODE_PAGE_INC, MODE_PAGE_DEC, MODE_DRAG, MODE_FINE_DRAG } |
Protected Member Functions | |
| void | drawButton (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXbool down) |
| void | drawThumb (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h) |
| void | drawLeftArrow (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXbool down) |
| void | drawRightArrow (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXbool down) |
| void | drawUpArrow (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXbool down) |
| void | drawDownArrow (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXbool down) |
Protected Attributes | |
| FXint | range |
| FXint | page |
| FXint | line |
| FXint | pos |
| FXint | barsize |
| FXint | thumbsize |
| FXint | thumbpos |
| FXColor | hiliteColor |
| FXColor | shadowColor |
| FXColor | borderColor |
| FXColor | arrowColor |
| FXint | dragpoint |
| FXuchar | mode |
The scroll bar is used when a document has a larger content than may be made visible.
The range is the total size of the document, the page size is the viewable space available for the document. The size of the scrollbar thumb is adjusted to give feedback of the relative sizes of each. The scroll bar may be manipulated by the left mouse button (normal scrolling), by the middle mouse button (same as the left mouse only the scroll position can jump to the place where the click is made), or by the right mouse button (vernier- or fine-scrolling). Holding down the control key while scrolling with the left or middle mouse button also enables vernier-scrolling mode. The vernier-scrolling mode is very useful for accurate positioning in large documents. Finally, if the mouse sports a wheel, the scroll bar can be manipulated by means of the mouse wheel as well. Holding down the Control-key during wheel motion will cause the scrolling to go faster than normal. While moving the scroll bar, a message of type SEL_CHANGED will be sent to the target, and the message data will reflect the current position of type FXint. At the end of the interaction, the scroll bar will send a message of type SEL_COMMAND to notify the target of the final position.
| void FX::FXScrollBar::setPage | ( | FXint | p, |
| FXbool | notify = false |
||
| ) |
Set the viewable page size.
The page size must be at least 1, but may be larger than the range.
| void FX::FXScrollBar::setPosition | ( | FXint | p, |
| FXbool | notify = false |
||
| ) |
Change scroll position.
The position is always greater or equal to 0, up to the range less the page size. If the range is less than the page size, the position will simply be equal to zero.
| void FX::FXScrollBar::setRange | ( | FXint | r, |
| FXbool | notify = false |
||
| ) |
Set content size range.
The range must be at least 1, but may be smaller than the viewable page size.
|
|