PageRenderTime 28ms CodeModel.GetById 18ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llui/llcontainerview.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 94 lines | 54 code | 14 blank | 26 comment | 0 complexity | 04b089224a17ce3db4a3be885d752a2d MD5 | raw file
 1/** 
 2 * @file llcontainerview.h
 3 * @brief Container for all statistics info.
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLCONTAINERVIEW_H
28#define LL_LLCONTAINERVIEW_H
29
30#include "stdtypes.h"
31#include "lltextbox.h"
32#include "llstatbar.h"
33#include "llview.h"
34
35class LLScrollContainer;
36
37struct ContainerViewRegistry : public LLChildRegistry<ContainerViewRegistry>
38{};
39
40class LLContainerView : public LLView
41{
42public:
43	struct Params : public LLInitParam::Block<Params, LLView::Params>
44	{
45		Optional<std::string> label;
46		Optional<bool> show_label;
47		Optional<bool> display_children;
48		Params()
49			: label("label"),
50			  show_label("show_label", FALSE),
51			  display_children("display_children", TRUE)
52		{
53			changeDefault(mouse_opaque, false);
54		}
55	};
56
57	// my valid children are stored in this registry
58 	typedef ContainerViewRegistry child_registry_t;
59	
60protected:
61	LLContainerView(const Params& p);
62	friend class LLUICtrlFactory;
63public:
64	~LLContainerView();
65
66	/*virtual*/ BOOL postBuild();
67	/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
68	
69	/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
70	/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
71
72	/*virtual*/ void draw();
73	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
74	/*virtual*/ LLRect getRequiredRect();	// Return the height of this object, given the set options.
75
76	void setLabel(const std::string& label);
77	void showLabel(BOOL show) { mShowLabel = show; }
78	void setDisplayChildren(const BOOL displayChildren);
79	BOOL getDisplayChildren() { return mDisplayChildren; }
80	void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;}
81
82 private:
83	LLScrollContainer* mScrollContainer;
84	void arrange(S32 width, S32 height, BOOL called_from_parent = TRUE);
85	BOOL mShowLabel;
86
87protected:
88	BOOL mDisplayChildren;
89	std::string mLabel;
90public:
91	BOOL mCollapsible;
92
93};
94#endif // LL_CONTAINERVIEW_