diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llui/llscrollcontainer.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llui/llscrollcontainer.h')
-rw-r--r-- | linden/indra/llui/llscrollcontainer.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/linden/indra/llui/llscrollcontainer.h b/linden/indra/llui/llscrollcontainer.h new file mode 100644 index 0000000..f6bacda --- /dev/null +++ b/linden/indra/llui/llscrollcontainer.h | |||
@@ -0,0 +1,129 @@ | |||
1 | /** | ||
2 | * @file llscrollcontainer.h | ||
3 | * @brief LLScrollableContainerView class header file. | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLSCROLLCONTAINER_H | ||
29 | #define LL_LLSCROLLCONTAINER_H | ||
30 | |||
31 | #include "lluictrl.h" | ||
32 | #ifndef LL_V4COLOR_H | ||
33 | #include "v4color.h" | ||
34 | #endif | ||
35 | #include "stdenums.h" | ||
36 | #include "llcoord.h" | ||
37 | |||
38 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
39 | // Class LLScrollableContainerView | ||
40 | // | ||
41 | // A view meant to encapsulate a clipped region which is | ||
42 | // scrollable. It automatically takes care of pixel perfect scrolling | ||
43 | // and cliipping, as well as turning the scrollbars on or off based on | ||
44 | // the width and height of the view you're scrolling. | ||
45 | // | ||
46 | // This class is a decorator class. | ||
47 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
48 | |||
49 | class LLScrollbar; | ||
50 | class LLViewBorder; | ||
51 | class LLUICtrlFactory; | ||
52 | |||
53 | |||
54 | class LLScrollableContainerView : public LLUICtrl | ||
55 | { | ||
56 | public: | ||
57 | LLScrollableContainerView( const LLString& name, const LLRect& rect, | ||
58 | LLView* scrolled_view, BOOL is_opaque = FALSE, | ||
59 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); | ||
60 | LLScrollableContainerView( const LLString& name, const LLRect& rect, | ||
61 | LLUICtrl* scrolled_ctrl, BOOL is_opaque = FALSE, | ||
62 | const LLColor4& bg_color = LLColor4(0,0,0,0) ); | ||
63 | virtual ~LLScrollableContainerView( void ); | ||
64 | |||
65 | void init(); | ||
66 | |||
67 | void setScrolledView(LLView* view) { mScrolledView = view; } | ||
68 | |||
69 | virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } | ||
70 | virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLL_CONTAINER; } | ||
71 | virtual LLString getWidgetTag() const { return LL_SCROLLABLE_CONTAINER_VIEW_TAG; } | ||
72 | |||
73 | // scrollbar handlers | ||
74 | static void horizontalChange( S32 new_pos, LLScrollbar* sb, void* user_data ); | ||
75 | static void verticalChange( S32 new_pos, LLScrollbar* sb, void* user_data ); | ||
76 | |||
77 | void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ); | ||
78 | void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ); | ||
79 | void setBorderVisible( BOOL b ); | ||
80 | |||
81 | void scrollToShowRect( const LLRect& rect, const LLCoordGL& desired_offset ); | ||
82 | void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } | ||
83 | const LLRect& getScrolledViewRect() { return mScrolledView->getRect(); } | ||
84 | void pageUp(S32 overlap = 0); | ||
85 | void pageDown(S32 overlap = 0); | ||
86 | void goToTop(); | ||
87 | void goToBottom(); | ||
88 | S32 getBorderWidth(); | ||
89 | |||
90 | // LLView functionality | ||
91 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent); | ||
92 | virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); | ||
93 | virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); | ||
94 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | ||
95 | EDragAndDropType cargo_type, | ||
96 | void* cargo_data, | ||
97 | EAcceptance* accept, | ||
98 | LLString& tooltip_msg); | ||
99 | |||
100 | virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | ||
101 | virtual void draw(); | ||
102 | |||
103 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | ||
104 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | ||
105 | |||
106 | protected: | ||
107 | // internal scrollbar handlers | ||
108 | virtual void scrollHorizontal( S32 new_pos ); | ||
109 | virtual void scrollVertical( S32 new_pos ); | ||
110 | void updateScroll(); | ||
111 | |||
112 | // Note: vertical comes before horizontal because vertical | ||
113 | // scrollbars have priority for mouse and keyboard events. | ||
114 | enum { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; | ||
115 | |||
116 | LLScrollbar* mScrollbar[SCROLLBAR_COUNT]; | ||
117 | LLView* mScrolledView; | ||
118 | S32 mSize; | ||
119 | BOOL mIsOpaque; | ||
120 | LLColor4 mBackgroundColor; | ||
121 | LLRect mInnerRect; | ||
122 | LLViewBorder* mBorder; | ||
123 | BOOL mReserveScrollCorner; | ||
124 | BOOL mAutoScrolling; | ||
125 | F32 mAutoScrollRate; | ||
126 | }; | ||
127 | |||
128 | |||
129 | #endif // LL_LLSCROLLCONTAINER_H | ||