Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXScrollbar Class Reference

#include <FXScrollbar.h>

Inheritance diagram for FXScrollbar:

FXWindow FXDrawable FXId FXObject List of all members.

Public Types

enum  {
  ID_TIMEWHEEL = FXWindow::ID_LAST,
  ID_AUTOINC_LINE,
  ID_AUTODEC_LINE,
  ID_AUTOINC_PAGE,
  ID_AUTODEC_PAGE,
  ID_AUTOINC_PIX,
  ID_AUTODEC_PIX,
  ID_LAST
}

Public Methods

 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.

void setRange (FXint r)
 Set content size range.

FXint getRange () const
 Return content size range.

void setPage (FXint p)
 Set viewport page size.

FXint getPage () const
 Return page size.

void setLine (FXint l)
 Set scoll increment for line.

FXint getLine () const
 Return line increment.

void setPosition (FXint p)
 Change current scroll position.

FXint getPosition () const
 return scroll position

void setHiliteColor (FXColor clr)
 Change highlight color.

FXColor getHiliteColor () const
 Return highlight color.

void setShadowColor (FXColor clr)
 Change shadow color.

FXColor getShadowColor () const
 Return shadow color.

FXColor getBorderColor () const
 Change border color.

void setBorderColor (FXColor clr)
 Return border color.

FXuint getScrollbarStyle () const
 Change the scrollbar style.

void setScrollbarStyle (FXuint style)
 Get the current scrollbar style.

virtual void save (FXStream &store) const
 Save to stream.

virtual void load (FXStream &store)
 Load from stream.

virtual ~FXScrollbar ()
 Destructor.


Detailed Description

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 is the part of the document which is visible. 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 (normal scrolling), right mouse (vernier or fine-scrolling), or middle mouse (same as the left mouse only the scroll position can hop to the place where the click is made). 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.