aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llscrollcontainer.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llscrollcontainer.h')
-rw-r--r--linden/indra/llui/llscrollcontainer.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/linden/indra/llui/llscrollcontainer.h b/linden/indra/llui/llscrollcontainer.h
index fb7198c..d512957 100644
--- a/linden/indra/llui/llscrollcontainer.h
+++ b/linden/indra/llui/llscrollcontainer.h
@@ -40,21 +40,18 @@
40#include "llcoord.h" 40#include "llcoord.h"
41#include "llscrollbar.h" 41#include "llscrollbar.h"
42 42
43//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44// Class LLScrollableContainerView
45//
46// A view meant to encapsulate a clipped region which is
47// scrollable. It automatically takes care of pixel perfect scrolling
48// and cliipping, as well as turning the scrollbars on or off based on
49// the width and height of the view you're scrolling.
50//
51// This class is a decorator class.
52//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 43
54class LLViewBorder; 44class LLViewBorder;
55class LLUICtrlFactory; 45class LLUICtrlFactory;
56 46
57 47/*****************************************************************************
48 *
49 * A decorator view class meant to encapsulate a clipped region which is
50 * scrollable. It automatically takes care of pixel perfect scrolling
51 * and cliipping, as well as turning the scrollbars on or off based on
52 * the width and height of the view you're scrolling.
53 *
54 *****************************************************************************/
58class LLScrollableContainerView : public LLUICtrl 55class LLScrollableContainerView : public LLUICtrl
59{ 56{
60public: 57public:
@@ -70,32 +67,26 @@ public:
70 const LLColor4& bg_color = LLColor4(0,0,0,0) ); 67 const LLColor4& bg_color = LLColor4(0,0,0,0) );
71 virtual ~LLScrollableContainerView( void ); 68 virtual ~LLScrollableContainerView( void );
72 69
73 void init();
74
75 void setScrolledView(LLView* view) { mScrolledView = view; } 70 void setScrolledView(LLView* view) { mScrolledView = view; }
76 71
77 virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } 72 virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); }
78 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLL_CONTAINER; } 73 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLL_CONTAINER; }
79 virtual LLString getWidgetTag() const { return LL_SCROLLABLE_CONTAINER_VIEW_TAG; } 74 virtual LLString getWidgetTag() const { return LL_SCROLLABLE_CONTAINER_VIEW_TAG; }
80 75
81 // scrollbar handlers 76 void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
82 static void horizontalChange( S32 new_pos, LLScrollbar* sb, void* user_data ); 77 void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
83 static void verticalChange( S32 new_pos, LLScrollbar* sb, void* user_data );
84
85 void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar );
86 void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar );
87 void setBorderVisible( BOOL b ); 78 void setBorderVisible( BOOL b );
88 79
89 void scrollToShowRect( const LLRect& rect, const LLCoordGL& desired_offset ); 80 void scrollToShowRect( const LLRect& rect, const LLCoordGL& desired_offset );
90 void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } 81 void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; }
91 const LLRect& getScrolledViewRect() { return mScrolledView->getRect(); } 82 const LLRect& getScrolledViewRect() const { return mScrolledView->getRect(); }
92 void pageUp(S32 overlap = 0); 83 void pageUp(S32 overlap = 0);
93 void pageDown(S32 overlap = 0); 84 void pageDown(S32 overlap = 0);
94 void goToTop(); 85 void goToTop();
95 void goToBottom(); 86 void goToBottom();
96 S32 getBorderWidth(); 87 S32 getBorderWidth() const;
97 88
98 BOOL needsToScroll(S32 x, S32 y, SCROLL_ORIENTATION axis); 89 BOOL needsToScroll(S32 x, S32 y, SCROLL_ORIENTATION axis) const;
99 90
100 // LLView functionality 91 // LLView functionality
101 virtual void reshape(S32 width, S32 height, BOOL called_from_parent); 92 virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
@@ -113,7 +104,9 @@ public:
113 virtual LLXMLNodePtr getXML(bool save_children = true) const; 104 virtual LLXMLNodePtr getXML(bool save_children = true) const;
114 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 105 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
115 106
116protected: 107private:
108 void init();
109
117 // internal scrollbar handlers 110 // internal scrollbar handlers
118 virtual void scrollHorizontal( S32 new_pos ); 111 virtual void scrollHorizontal( S32 new_pos );
119 virtual void scrollVertical( S32 new_pos ); 112 virtual void scrollVertical( S32 new_pos );