#include <llscrollbar.h>
Public Types | |
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 BOOL | handleKeyHere (KEY key, MASK mask) |
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 *cargo_data, EAcceptance *accept, LLString &tooltip_msg) |
virtual void | reshape (S32 width, S32 height, BOOL called_from_parent=TRUE) |
virtual void | draw () |
void | setDocSize (S32 size) |
S32 | getDocSize () const |
void | setDocPos (S32 pos) |
S32 | getDocPos () const |
BOOL | isAtBeginning () |
BOOL | isAtEnd () |
void | setDocParams (S32 size, S32 pos) |
void | setPageSize (S32 page_size) |
S32 | getPageSize () const |
S32 | getDocPosMax () const |
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) |
Private Member Functions | |
void | updateThumbRect () |
void | changeLine (S32 delta, BOOL update_thumb) |
Private Attributes | |
void(* | mChangeCallback )(S32 new_pos, LLScrollbar *self, void *userdata) |
void * | mCallbackUserData |
const 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 *) |
void * | mOnScrollEndData |
Definition at line 48 of file llscrollbar.h.
LLScrollbar::LLScrollbar | ( | const LLString & | name, | |
LLRect | rect, | |||
LLScrollbar::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 51 of file llscrollbar.cpp.
References LLView::addChild(), FALSE, LLView::getRect(), mOrientation, 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 147 of file llscrollbar.cpp.
void LLScrollbar::setValue | ( | const LLSD & | value | ) | [virtual] |
Reimplemented from LLView.
Definition at line 560 of file llscrollbar.cpp.
References LLSD::asInteger(), S32, and setDocPos().
Reimplemented from LLView.
Definition at line 566 of file llscrollbar.cpp.
References changeLine(), FALSE, getDocPosMax(), KEY_DOWN, KEY_END, KEY_HOME, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_UP, mDocPos, mStepSize, pageDown(), pageUp(), and TRUE.
Reimplemented from LLView.
Definition at line 251 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.
Reimplemented from LLView.
Definition at line 443 of file llscrollbar.cpp.
References FALSE, gFocusMgr, LLView::handleMouseUp(), LLView::hasMouseCapture(), NULL, LLFocusMgr::setMouseCapture(), and TRUE.
Reimplemented from LLView.
Definition at line 296 of file llscrollbar.cpp.
References changeLine(), LLView::childrenHandleMouseUp(), FALSE, getDocPosMax(), LLRectBase< Type >::getHeight(), LLView::getName(), LLView::getRect(), LLRectBase< Type >::getWidth(), LLView::getWindow(), LLView::hasMouseCapture(), llclamp(), lldebugst, llendl, LLRectBase< Type >::mBottom, mDocChanged, mDocPos, mDragStartX, mDragStartY, mLastDelta, LLRectBase< Type >::mLeft, mOrientation, mOrigRect, LLRectBase< Type >::mRight, mThumbRect, LLRectBase< Type >::mTop, NULL, S32, SCROLLBAR_SIZE, LLWindow::setCursor(), TRUE, UI_CURSOR_ARROW, and VERTICAL.
Reimplemented from LLView.
Definition at line 415 of file llscrollbar.cpp.
References changeLine(), mStepSize, and TRUE.
Referenced by LLTextEditor::handleScrollWheel(), and LLScrollListCtrl::handleScrollWheel().
BOOL LLScrollbar::handleDragAndDrop | ( | S32 | x, | |
S32 | y, | |||
MASK | mask, | |||
BOOL | drop, | |||
EDragAndDropType | cargo_type, | |||
void * | cargo_data, | |||
EAcceptance * | accept, | |||
LLString & | tooltip_msg | |||
) | [virtual] |
Reimplemented from LLView.
Definition at line 460 of file llscrollbar.cpp.
References LLView::reshape(), and updateThumbRect().
Referenced by LLScrollListCtrl::updateLayout(), and LLScrollableContainerView::updateScroll().
void LLScrollbar::draw | ( | void | ) | [virtual] |
Reimplemented from LLView.
Definition at line 467 of file llscrollbar.cpp.
References LLWindow::convertCoords(), LLView::draw(), LLUIImage::draw(), LLUIImage::drawSolid(), LLWindow::getCursorPosition(), getDocPos(), getDocPosMax(), LLView::getEnabled(), LLFocusMgr::getFocusColor(), LLCriticalDamp::getInterpolant(), LLFocusMgr::getKeyboardFocus(), LLFocusMgr::getMouseCapture(), LLView::getRect(), LLImageProviderInterface::getUIImage(), LLView::getWindow(), gFocusMgr, gl_rect_2d(), LLView::hasMouseCapture(), HORIZONTAL, lerp(), mCurGlowStrength, mHoverGlowStrength, mOnScrollEndCallback, mOnScrollEndData, mOrientation, mThumbColor, mThumbRect, mTrackColor, LLCoord::mX, LLCoord::mY, LLRectBase< Type >::pointInRect(), S32, LLView::screenPointToLocal(), SCROLLBAR_SIZE, LLUI::sImageProvider, LLRectBase< Type >::stretch(), TRUE, and VERTICAL.
void LLScrollbar::setDocSize | ( | S32 | size | ) |
Definition at line 172 of file llscrollbar.cpp.
References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mDocSize, TRUE, and updateThumbRect().
Referenced by LLScrollableContainerView::reshape(), LLScrollableContainerView::scrollToShowRect(), LLScrollListCtrl::updateLayout(), LLTextEditor::updateLineStartList(), LLScrollableContainerView::updateScroll(), and LLTextEditor::updateScrollFromCursor().
S32 LLScrollbar::getDocSize | ( | ) | const [inline] |
Definition at line 80 of file llscrollbar.h.
References mDocSize.
Referenced by LLScrollListCtrl::setEnabled(), LLTextEditor::setHideScrollbarForShortDocs(), and LLTextEditor::updateLineStartList().
void LLScrollbar::setDocPos | ( | S32 | pos | ) |
Definition at line 161 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().
S32 LLScrollbar::getDocPos | ( | ) | const [inline] |
Definition at line 85 of file llscrollbar.h.
References mDocPos.
Referenced by LLTextEditor::appendText(), LLTextEditor::changePage(), draw(), LLTextEditor::drawCursor(), LLTextEditor::drawPreeditMarker(), LLTextEditor::drawSelectionBackground(), LLTextEditor::drawText(), LLTextEditor::endOfDoc(), LLTextEditor::getCursorPosFromLocalCoord(), LLTextEditor::getPreeditLocation(), 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().
BOOL LLScrollbar::isAtBeginning | ( | ) |
Definition at line 196 of file llscrollbar.cpp.
References mDocPos.
Referenced by LLTextEditor::isScrolledToTop().
BOOL LLScrollbar::isAtEnd | ( | ) |
Definition at line 201 of file llscrollbar.cpp.
References getDocPosMax(), and mDocPos.
Referenced by LLTextEditor::isScrolledToBottom().
Definition at line 152 of file llscrollbar.cpp.
References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mDocSize, TRUE, and updateThumbRect().
Referenced by LLScrollListCtrl::clearRows().
void LLScrollbar::setPageSize | ( | S32 | page_size | ) |
Definition at line 184 of file llscrollbar.cpp.
References getDocPosMax(), llclamp(), mDocChanged, mDocPos, mPageSize, TRUE, and updateThumbRect().
Referenced by LLTextEditor::reshape(), LLScrollableContainerView::reshape(), LLScrollableContainerView::scrollToShowRect(), LLScrollListCtrl::updateLayout(), and LLScrollableContainerView::updateScroll().
S32 LLScrollbar::getPageSize | ( | ) | const [inline] |
Definition at line 95 of file llscrollbar.h.
References mPageSize.
Referenced by LLTextEditor::changePage(), LLScrollListCtrl::handleKeyHere(), LLScrollListCtrl::setEnabled(), LLTextEditor::setHideScrollbarForShortDocs(), LLTextEditor::updateLineStartList(), and LLTextEditor::updateScrollFromCursor().
S32 LLScrollbar::getDocPosMax | ( | ) | const [inline] |
Definition at line 98 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(), isAtEnd(), setDocParams(), setDocPos(), setDocSize(), setPageSize(), LLTextEditor::updateScrollFromCursor(), and updateThumbRect().
void LLScrollbar::pageUp | ( | S32 | overlap | ) |
Definition at line 604 of file llscrollbar.cpp.
References changeLine(), mDocSize, mPageSize, and TRUE.
Referenced by handleKeyHere(), handleMouseDown(), and LLScrollableContainerView::pageUp().
void LLScrollbar::pageDown | ( | S32 | overlap | ) |
Definition at line 612 of file llscrollbar.cpp.
References changeLine(), mDocSize, mPageSize, and TRUE.
Referenced by handleKeyHere(), handleMouseDown(), and LLScrollableContainerView::pageDown().
void LLScrollbar::onLineUpBtnPressed | ( | void * | userdata | ) | [static] |
Definition at line 621 of file llscrollbar.cpp.
References TRUE.
Referenced by LLScrollbar().
void LLScrollbar::onLineDownBtnPressed | ( | void * | userdata | ) | [static] |
Definition at line 629 of file llscrollbar.cpp.
References TRUE.
Referenced by LLScrollbar().
void LLScrollbar::setTrackColor | ( | const LLColor4 & | color | ) | [inline] |
Definition at line 106 of file llscrollbar.h.
References mTrackColor.
Referenced by LLTextEditor::setTrackColor().
void LLScrollbar::setThumbColor | ( | const LLColor4 & | color | ) | [inline] |
Definition at line 107 of file llscrollbar.h.
References mThumbColor.
Referenced by LLTextEditor::setThumbColor().
void LLScrollbar::setHighlightColor | ( | const LLColor4 & | color | ) | [inline] |
Definition at line 108 of file llscrollbar.h.
References mHighlightColor.
Referenced by LLTextEditor::setHighlightColor().
void LLScrollbar::setShadowColor | ( | const LLColor4 & | color | ) | [inline] |
Definition at line 109 of file llscrollbar.h.
References mShadowColor.
Referenced by LLTextEditor::setShadowColor().
void LLScrollbar::setOnScrollEndCallback | ( | void(*)(void *) | callback, | |
void * | userdata | |||
) | [inline] |
Definition at line 111 of file llscrollbar.h.
References mOnScrollEndCallback, and mOnScrollEndData.
Referenced by LLTextEditor::LLTextEditor(), and LLTextEditor::setOnScrollEndCallback().
void LLScrollbar::updateThumbRect | ( | ) | [private] |
Definition at line 207 of file llscrollbar.cpp.
References getDocPosMax(), LLRectBase< Type >::getHeight(), LLView::getRect(), LLRectBase< Type >::getWidth(), HORIZONTAL, llclamp(), llmax(), llmin(), LLRectBase< Type >::mBottom, mDocPos, mDocSize, LLRectBase< Type >::mLeft, mOnScrollEndCallback, mOnScrollEndData, mOrientation, mPageSize, LLRectBase< Type >::mRight, mThumbRect, LLRectBase< Type >::mTop, S32, SCROLLBAR_SIZE, and VERTICAL.
Referenced by changeLine(), LLScrollbar(), reshape(), setDocParams(), setDocPos(), setDocSize(), and setPageSize().
Definition at line 541 of file llscrollbar.cpp.
References getDocPosMax(), llclamp(), mCallbackUserData, mChangeCallback, mDocPos, S32, and updateThumbRect().
Referenced by handleHover(), handleKeyHere(), handleScrollWheel(), pageDown(), and pageUp().
void(* LLScrollbar::mChangeCallback)(S32 new_pos, LLScrollbar *self, void *userdata) [private] |
Referenced by changeLine().
void* LLScrollbar::mCallbackUserData [private] |
Reimplemented from LLUICtrl.
Definition at line 118 of file llscrollbar.h.
Referenced by changeLine().
const ORIENTATION LLScrollbar::mOrientation [private] |
Definition at line 120 of file llscrollbar.h.
Referenced by draw(), handleHover(), handleMouseDown(), LLScrollbar(), and updateThumbRect().
S32 LLScrollbar::mDocSize [private] |
Definition at line 121 of file llscrollbar.h.
Referenced by getDocPosMax(), getDocSize(), pageDown(), pageUp(), setDocParams(), setDocSize(), and updateThumbRect().
S32 LLScrollbar::mDocPos [private] |
Definition at line 122 of file llscrollbar.h.
Referenced by changeLine(), getDocPos(), handleHover(), handleKeyHere(), isAtBeginning(), isAtEnd(), setDocParams(), setDocPos(), setDocSize(), setPageSize(), and updateThumbRect().
S32 LLScrollbar::mPageSize [private] |
Definition at line 123 of file llscrollbar.h.
Referenced by getDocPosMax(), getPageSize(), pageDown(), pageUp(), setPageSize(), and updateThumbRect().
S32 LLScrollbar::mStepSize [private] |
Definition at line 124 of file llscrollbar.h.
Referenced by handleKeyHere(), and handleScrollWheel().
BOOL LLScrollbar::mDocChanged [private] |
Definition at line 125 of file llscrollbar.h.
Referenced by handleHover(), setDocParams(), setDocPos(), setDocSize(), and setPageSize().
LLRect LLScrollbar::mThumbRect [private] |
Definition at line 127 of file llscrollbar.h.
Referenced by draw(), handleHover(), handleMouseDown(), and updateThumbRect().
S32 LLScrollbar::mDragStartX [private] |
S32 LLScrollbar::mDragStartY [private] |
F32 LLScrollbar::mHoverGlowStrength [private] |
F32 LLScrollbar::mCurGlowStrength [private] |
LLRect LLScrollbar::mOrigRect [private] |
S32 LLScrollbar::mLastDelta [private] |
LLColor4 LLScrollbar::mTrackColor [private] |
LLColor4 LLScrollbar::mThumbColor [private] |
LLColor4 LLScrollbar::mFocusColor [private] |
Definition at line 138 of file llscrollbar.h.
LLColor4 LLScrollbar::mHighlightColor [private] |
LLColor4 LLScrollbar::mShadowColor [private] |
void(* LLScrollbar::mOnScrollEndCallback)(void *) [private] |
Referenced by draw(), setOnScrollEndCallback(), and updateThumbRect().
void* LLScrollbar::mOnScrollEndData [private] |
Definition at line 143 of file llscrollbar.h.
Referenced by draw(), setOnScrollEndCallback(), and updateThumbRect().