LLScrollbar Class Reference

#include <llscrollbar.h>

Inheritance diagram for LLScrollbar:

Inheritance graph
[legend]
Collaboration diagram for LLScrollbar:

Collaboration graph
[legend]
List of all members.

Public Types

 HORIZONTAL
 VERTICAL
enum  ORIENTATION { HORIZONTAL, VERTICAL }

Public Member Functions

 LLScrollbar (const LLString &name, LLRect rect, ORIENTATION orientation, S32 doc_size, S32 doc_pos, S32 page_size, void(*change_callback)(S32 new_pos, LLScrollbar *self, void *userdata), void *callback_user_data=NULL, S32 step_size=1)
virtual ~LLScrollbar ()
virtual void setValue (const LLSD &value)
virtual EWidgetType getWidgetType () const
virtual LLString getWidgetTag () const
virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)
virtual BOOL handleMouseDown (S32 x, S32 y, MASK mask)
virtual BOOL handleMouseUp (S32 x, S32 y, MASK mask)
virtual BOOL handleHover (S32 x, S32 y, MASK mask)
virtual BOOL handleScrollWheel (S32 x, S32 y, S32 clicks)
virtual BOOL handleDragAndDrop (S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg)
virtual void reshape (S32 width, S32 height, BOOL called_from_parent=TRUE)
virtual void draw ()
void setDocParams (S32 size, S32 pos)
void setDocSize (S32 size)
S32 getDocSize ()
void setDocPos (S32 pos)
S32 getDocPos ()
void setPageSize (S32 page_size)
S32 getPageSize ()
S32 getDocPosMax ()
void pageUp (S32 overlap)
void pageDown (S32 overlap)
void setTrackColor (const LLColor4 &color)
void setThumbColor (const LLColor4 &color)
void setHighlightColor (const LLColor4 &color)
void setShadowColor (const LLColor4 &color)
void setOnScrollEndCallback (void(*callback)(void *), void *userdata)

Static Public Member Functions

static void onLineUpBtnPressed (void *userdata)
static void onLineDownBtnPressed (void *userdata)

Protected Member Functions

void updateThumbRect ()
void changeLine (S32 delta, BOOL update_thumb)

Protected Attributes

void(* mChangeCallback )(S32 new_pos, LLScrollbar *self, void *userdata)
voidmCallbackUserData
ORIENTATION mOrientation
S32 mDocSize
S32 mDocPos
S32 mPageSize
S32 mStepSize
BOOL mDocChanged
LLRect mThumbRect
S32 mDragStartX
S32 mDragStartY
F32 mHoverGlowStrength
F32 mCurGlowStrength
LLRect mOrigRect
S32 mLastDelta
LLColor4 mTrackColor
LLColor4 mThumbColor
LLColor4 mFocusColor
LLColor4 mHighlightColor
LLColor4 mShadowColor
void(* mOnScrollEndCallback )(void *)
voidmOnScrollEndData

Detailed Description

Definition at line 48 of file llscrollbar.h.


Member Enumeration Documentation

enum LLScrollbar::ORIENTATION

Enumerator:
HORIZONTAL 
VERTICAL 

Definition at line 52 of file llscrollbar.h.


Constructor & Destructor Documentation

LLScrollbar::LLScrollbar ( const LLString name,
LLRect  rect,
ORIENTATION  orientation,
S32  doc_size,
S32  doc_pos,
S32  page_size,
void(*)(S32 new_pos, LLScrollbar *self, void *userdata)  change_callback,
void callback_user_data = NULL,
S32  step_size = 1 
)

Definition at line 50 of file llscrollbar.cpp.

References LLView::addChild(), FALSE, LLRectBase< Type >::getHeight(), LLRectBase< Type >::getWidth(), mOrientation, LLView::mRect, onLineDownBtnPressed(), onLineUpBtnPressed(), SCROLLBAR_SIZE, LLView::setFollowsBottom(), LLView::setFollowsLeft(), LLView::setFollowsRight(), LLView::setFollowsTop(), LLButton::setHeldDownCallback(), LLRectBase< Type >::setLeftTopAndSize(), LLRectBase< Type >::setOriginAndSize(), LLUICtrl::setTabStop(), LLFontGL::sSansSerif, updateThumbRect(), and VERTICAL.

LLScrollbar::~LLScrollbar (  )  [virtual]

Definition at line 146 of file llscrollbar.cpp.


Member Function Documentation

void LLScrollbar::changeLine ( S32  delta,
BOOL  update_thumb 
) [protected]

Definition at line 538 of file llscrollbar.cpp.

References getDocPosMax(), llclamp(), mCallbackUserData, mChangeCallback, mDocPos, S32, and updateThumbRect().

Referenced by handleHover(), handleKeyHere(), handleScrollWheel(), pageDown(), and pageUp().

void LLScrollbar::draw (  )  [virtual]

Reimplemented from LLView.

Definition at line 455 of file llscrollbar.cpp.

References LLWindow::convertCoords(), LLView::draw(), f, LLWindow::getCursorPosition(), getDocPos(), getDocPosMax(), LLFocusMgr::getFocusColor(), LLRectBase< Type >::getHeight(), LLCriticalDamp::getInterpolant(), LLFocusMgr::getKeyboardFocus(), LLFocusMgr::getMouseCapture(), LLImageProviderInterface::getUIImageByID(), LLView::getVisible(), LLRectBase< Type >::getWidth(), LLView::getWindow(), gFocusMgr, gl_draw_scaled_image_with_border(), gl_rect_2d(), glBlendFunc, LLView::hasMouseCapture(), HORIZONTAL, lerp(), LLRectBase< Type >::mBottom, mCurGlowStrength, LLView::mEnabled, mHoverGlowStrength, LLRectBase< Type >::mLeft, mOnScrollEndCallback, mOnScrollEndData, mOrientation, LLView::mRect, mThumbColor, mThumbRect, mTrackColor, LLCoord::mX, LLCoord::mY, LLRectBase< Type >::pointInRect(), S32, LLUI::sAssetsGroup, LLView::screenPointToLocal(), SCROLLBAR_SIZE, LLUUID::set(), LLUI::sImageProvider, LLRectBase< Type >::stretch(), TRUE, and VERTICAL.

S32 LLScrollbar::getDocPos (  )  [inline]

Definition at line 89 of file llscrollbar.h.

References mDocPos.

Referenced by LLTextEditor::appendText(), LLTextEditor::changePage(), draw(), LLTextEditor::drawCursor(), LLTextEditor::drawSelectionBackground(), LLTextEditor::drawText(), LLTextEditor::endOfDoc(), LLTextEditor::getCursorPosFromLocalCoord(), LLScrollListCtrl::getScrollPos(), LLScrollableContainerView::handleDragAndDrop(), LLViewerTextEditor::handleHover(), LLTextEditor::handleHover(), LLViewerTextEditor::handleMouseDown(), LLViewerTextEditor::handleMouseUp(), LLTextEditor::handleMouseUp(), LLTextEditor::handleNavigationKey(), LLScrollableContainerView::needsToScroll(), LLTextEditor::replaceTextAll(), LLScrollableContainerView::scrollToShowRect(), LLScrollListCtrl::setScrollPos(), and LLTextEditor::updateScrollFromCursor().

S32 LLScrollbar::getDocPosMax (  )  [inline]

Definition at line 96 of file llscrollbar.h.

References llmax(), mDocSize, and mPageSize.

Referenced by LLTextEditor::appendText(), changeLine(), LLTextEditor::changePage(), draw(), LLTextEditor::endOfDoc(), LLScrollableContainerView::handleDragAndDrop(), LLTextEditor::handleHover(), handleHover(), handleKeyHere(), LLViewerTextEditor::handleMouseDown(), LLViewerTextEditor::handleMouseUp(), LLTextEditor::handleNavigationKey(), LLScrollListCtrl::reshape(), setDocParams(), setDocPos(), setDocSize(), setPageSize(), LLTextEditor::updateScrollFromCursor(), and updateThumbRect().

S32 LLScrollbar::getDocSize (  )  [inline]

Definition at line 84 of file llscrollbar.h.

References mDocSize.

Referenced by LLScrollListCtrl::setEnabled(), LLTextEditor::setHideScrollbarForShortDocs(), and LLTextEditor::updateLineStartList().

S32 LLScrollbar::getPageSize (  )  [inline]

Definition at line 93 of file llscrollbar.h.

References mPageSize.

Referenced by LLTextEditor::changePage(), LLScrollListCtrl::handleKeyHere(), LLScrollListCtrl::setEnabled(), LLTextEditor::setHideScrollbarForShortDocs(), LLTextEditor::updateLineStartList(), and LLTextEditor::updateScrollFromCursor().

LLString LLScrollbar::getWidgetTag (  )  const [virtual]

Implements LLView.

Definition at line 567 of file llscrollbar.cpp.

References LL_SCROLLBAR_TAG.

EWidgetType LLScrollbar::getWidgetType (  )  const [virtual]

Implements LLView.

Definition at line 562 of file llscrollbar.cpp.

References WIDGET_TYPE_SCROLLBAR.

BOOL LLScrollbar::handleDragAndDrop ( S32  x,
S32  y,
MASK  mask,
BOOL  drop,
EDragAndDropType  cargo_type,
void carge_data,
EAcceptance accept,
LLString tooltip_msg 
) [virtual]

Reimplemented from LLView.

Definition at line 409 of file llscrollbar.cpp.

References FALSE.

BOOL LLScrollbar::handleHover ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 275 of file llscrollbar.cpp.

References changeLine(), LLView::childrenHandleMouseUp(), f, FALSE, getDocPosMax(), LLRectBase< Type >::getHeight(), LLView::getName(), LLRectBase< Type >::getWidth(), LLView::getWindow(), LLView::hasMouseCapture(), height, llclamp(), lldebugst, llendl, LLRectBase< Type >::mBottom, mDocChanged, mDocPos, mDragStartX, mDragStartY, mLastDelta, LLRectBase< Type >::mLeft, mOrientation, mOrigRect, LLView::mRect, LLRectBase< Type >::mRight, mThumbRect, LLRectBase< Type >::mTop, NULL, S32, SCROLLBAR_SIZE, LLWindow::setCursor(), TRUE, UI_CURSOR_ARROW, VERTICAL, and width.

BOOL LLScrollbar::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLView.

Definition at line 572 of file llscrollbar.cpp.

References changeLine(), FALSE, getDocPosMax(), LLView::getVisible(), KEY_DOWN, KEY_END, KEY_HOME, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_UP, mDocPos, LLView::mEnabled, mStepSize, pageDown(), pageUp(), and TRUE.

BOOL LLScrollbar::handleMouseDown ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 230 of file llscrollbar.cpp.

References LLView::childrenHandleMouseDown(), gFocusMgr, HORIZONTAL, LLRectBase< Type >::mBottom, mDragStartX, mDragStartY, mLastDelta, LLRectBase< Type >::mLeft, mOrientation, mOrigRect, LLRectBase< Type >::mRight, mThumbRect, LLRectBase< Type >::mTop, NULL, pageDown(), pageUp(), LLRectBase< Type >::pointInRect(), LLFocusMgr::setMouseCapture(), TRUE, and VERTICAL.

BOOL LLScrollbar::handleMouseUp ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 431 of file llscrollbar.cpp.

References FALSE, gFocusMgr, LLView::handleMouseUp(), LLView::hasMouseCapture(), NULL, LLFocusMgr::setMouseCapture(), and TRUE.

BOOL LLScrollbar::handleScrollWheel ( S32  x,
S32  y,
S32  clicks 
) [virtual]

Reimplemented from LLView.

Definition at line 394 of file llscrollbar.cpp.

References changeLine(), FALSE, LLView::getEnabled(), LLView::getVisible(), LLRectBase< Type >::localPointInRect(), LLView::mRect, mStepSize, and TRUE.

Referenced by LLTextEditor::handleScrollWheel(), and LLScrollListCtrl::handleScrollWheel().

void LLScrollbar::onLineDownBtnPressed ( void userdata  )  [static]

Definition at line 638 of file llscrollbar.cpp.

References TRUE.

Referenced by LLScrollbar().

void LLScrollbar::onLineUpBtnPressed ( void userdata  )  [static]

Definition at line 630 of file llscrollbar.cpp.

References TRUE.

Referenced by LLScrollbar().

void LLScrollbar::pageDown ( S32  overlap  ) 

Definition at line 621 of file llscrollbar.cpp.

References changeLine(), mDocSize, mPageSize, and TRUE.

Referenced by handleKeyHere(), handleMouseDown(), and LLScrollableContainerView::pageDown().

void LLScrollbar::pageUp ( S32  overlap  ) 

Definition at line 613 of file llscrollbar.cpp.

References changeLine(), mDocSize, mPageSize, and TRUE.

Referenced by handleKeyHere(), handleMouseDown(), and LLScrollableContainerView::pageUp().

void LLScrollbar::reshape ( S32  width,
S32  height,
BOOL  called_from_parent = TRUE 
) [virtual]

Reimplemented from LLView.

Definition at line 448 of file llscrollbar.cpp.

References LLView::reshape(), and updateThumbRect().

Referenced by LLScrollListCtrl::setHeadingHeight(), and LLScrollableContainerView::updateScroll().

void LLScrollbar::setDocParams ( S32  size,
S32  pos 
)

Definition at line 151 of file llscrollbar.cpp.

References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mDocSize, TRUE, and updateThumbRect().

Referenced by LLScrollListCtrl::clearRows().

void LLScrollbar::setDocPos ( S32  pos  ) 

Definition at line 160 of file llscrollbar.cpp.

References getDocPosMax(), llclamp(), mDocChanged, mDocPos, TRUE, and updateThumbRect().

Referenced by LLTextEditor::changePage(), LLTextEditor::endOfDoc(), LLScrollableContainerView::goToBottom(), LLScrollableContainerView::goToTop(), LLScrollableContainerView::handleDragAndDrop(), LLViewerTextEditor::handleHover(), LLTextEditor::handleHover(), LLViewerTextEditor::handleMouseUp(), LLTextEditor::handleMouseUp(), LLTextEditor::handleNavigationKey(), LLTextEditor::replaceTextAll(), LLScrollableContainerView::scrollToShowRect(), LLScrollListCtrl::setScrollPos(), setValue(), LLScrollableContainerView::updateScroll(), and LLTextEditor::updateScrollFromCursor().

void LLScrollbar::setDocSize ( S32  size  ) 

Definition at line 168 of file llscrollbar.cpp.

References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mDocSize, TRUE, and updateThumbRect().

Referenced by LLScrollListCtrl::addItem(), LLScrollableContainerView::reshape(), LLScrollableContainerView::scrollToShowRect(), LLTextEditor::updateLineStartList(), LLScrollableContainerView::updateScroll(), and LLTextEditor::updateScrollFromCursor().

void LLScrollbar::setHighlightColor ( const LLColor4 color  )  [inline]

Definition at line 106 of file llscrollbar.h.

References mHighlightColor.

Referenced by LLTextEditor::setHighlightColor().

void LLScrollbar::setOnScrollEndCallback ( void(*)(void *)  callback,
void userdata 
) [inline]

Definition at line 109 of file llscrollbar.h.

References mOnScrollEndCallback, and mOnScrollEndData.

Referenced by LLTextEditor::LLTextEditor(), and LLTextEditor::setOnScrollEndCallback().

void LLScrollbar::setPageSize ( S32  page_size  ) 

Definition at line 177 of file llscrollbar.cpp.

References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mPageSize, TRUE, and updateThumbRect().

Referenced by LLScrollListCtrl::addItem(), LLTextEditor::reshape(), LLScrollListCtrl::reshape(), LLScrollableContainerView::reshape(), LLScrollableContainerView::scrollToShowRect(), and LLScrollableContainerView::updateScroll().

void LLScrollbar::setShadowColor ( const LLColor4 color  )  [inline]

Definition at line 107 of file llscrollbar.h.

References mShadowColor.

Referenced by LLTextEditor::setShadowColor().

void LLScrollbar::setThumbColor ( const LLColor4 color  )  [inline]

Definition at line 105 of file llscrollbar.h.

References mThumbColor.

Referenced by LLTextEditor::setThumbColor().

void LLScrollbar::setTrackColor ( const LLColor4 color  )  [inline]

Definition at line 104 of file llscrollbar.h.

References mTrackColor.

Referenced by LLTextEditor::setTrackColor().

void LLScrollbar::setValue ( const LLSD value  )  [virtual]

Reimplemented from LLView.

Definition at line 557 of file llscrollbar.cpp.

References LLSD::asInteger(), S32, and setDocPos().

void LLScrollbar::updateThumbRect (  )  [protected]

Definition at line 186 of file llscrollbar.cpp.

References getDocPosMax(), LLRectBase< Type >::getHeight(), LLRectBase< Type >::getWidth(), HORIZONTAL, llclamp(), llmax(), llmin(), LLRectBase< Type >::mBottom, mDocPos, mDocSize, LLRectBase< Type >::mLeft, mOnScrollEndCallback, mOnScrollEndData, mOrientation, mPageSize, LLView::mRect, LLRectBase< Type >::mRight, mThumbRect, LLRectBase< Type >::mTop, S32, SCROLLBAR_SIZE, and VERTICAL.

Referenced by changeLine(), LLScrollbar(), reshape(), setDocParams(), setDocPos(), setDocSize(), and setPageSize().


Member Data Documentation

void* LLScrollbar::mCallbackUserData [protected]

Reimplemented from LLUICtrl.

Definition at line 116 of file llscrollbar.h.

Referenced by changeLine().

void(* LLScrollbar::mChangeCallback)(S32 new_pos, LLScrollbar *self, void *userdata) [protected]

Referenced by changeLine().

F32 LLScrollbar::mCurGlowStrength [protected]

Definition at line 129 of file llscrollbar.h.

Referenced by draw().

BOOL LLScrollbar::mDocChanged [protected]

Definition at line 123 of file llscrollbar.h.

Referenced by handleHover(), setDocParams(), setDocPos(), setDocSize(), and setPageSize().

S32 LLScrollbar::mDocPos [protected]

Definition at line 120 of file llscrollbar.h.

Referenced by changeLine(), getDocPos(), handleHover(), handleKeyHere(), setDocParams(), setDocPos(), setDocSize(), setPageSize(), and updateThumbRect().

S32 LLScrollbar::mDocSize [protected]

Definition at line 119 of file llscrollbar.h.

Referenced by getDocPosMax(), getDocSize(), pageDown(), pageUp(), setDocParams(), setDocSize(), and updateThumbRect().

S32 LLScrollbar::mDragStartX [protected]

Definition at line 126 of file llscrollbar.h.

Referenced by handleHover(), and handleMouseDown().

S32 LLScrollbar::mDragStartY [protected]

Definition at line 127 of file llscrollbar.h.

Referenced by handleHover(), and handleMouseDown().

LLColor4 LLScrollbar::mFocusColor [protected]

Definition at line 136 of file llscrollbar.h.

LLColor4 LLScrollbar::mHighlightColor [protected]

Definition at line 137 of file llscrollbar.h.

Referenced by setHighlightColor().

F32 LLScrollbar::mHoverGlowStrength [protected]

Definition at line 128 of file llscrollbar.h.

Referenced by draw().

S32 LLScrollbar::mLastDelta [protected]

Definition at line 132 of file llscrollbar.h.

Referenced by handleHover(), and handleMouseDown().

void(* LLScrollbar::mOnScrollEndCallback)(void *) [protected]

Referenced by draw(), setOnScrollEndCallback(), and updateThumbRect().

void* LLScrollbar::mOnScrollEndData [protected]

Definition at line 141 of file llscrollbar.h.

Referenced by draw(), setOnScrollEndCallback(), and updateThumbRect().

ORIENTATION LLScrollbar::mOrientation [protected]

Definition at line 118 of file llscrollbar.h.

Referenced by draw(), handleHover(), handleMouseDown(), LLScrollbar(), and updateThumbRect().

LLRect LLScrollbar::mOrigRect [protected]

Definition at line 131 of file llscrollbar.h.

Referenced by handleHover(), and handleMouseDown().

S32 LLScrollbar::mPageSize [protected]

Definition at line 121 of file llscrollbar.h.

Referenced by getDocPosMax(), getPageSize(), pageDown(), pageUp(), setPageSize(), and updateThumbRect().

LLColor4 LLScrollbar::mShadowColor [protected]

Definition at line 138 of file llscrollbar.h.

Referenced by setShadowColor().

S32 LLScrollbar::mStepSize [protected]

Definition at line 122 of file llscrollbar.h.

Referenced by handleKeyHere(), and handleScrollWheel().

LLColor4 LLScrollbar::mThumbColor [protected]

Definition at line 135 of file llscrollbar.h.

Referenced by draw(), and setThumbColor().

LLRect LLScrollbar::mThumbRect [protected]

Definition at line 125 of file llscrollbar.h.

Referenced by draw(), handleHover(), handleMouseDown(), and updateThumbRect().

LLColor4 LLScrollbar::mTrackColor [protected]

Definition at line 134 of file llscrollbar.h.

Referenced by draw(), and setTrackColor().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:44 2010 for Second Life Viewer by  doxygen 1.4.7