aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterstats.cpp')
-rw-r--r--linden/indra/newview/llfloaterstats.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterstats.cpp b/linden/indra/newview/llfloaterstats.cpp
new file mode 100644
index 0000000..7b2acd4
--- /dev/null
+++ b/linden/indra/newview/llfloaterstats.cpp
@@ -0,0 +1,87 @@
1/**
2 * @file llfloaterstats.cpp
3 * @brief Container for statistics view
4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32
33
34#include "llviewerprecompiledheaders.h"
35
36#include "llfloaterstats.h"
37#include "llcontainerview.h"
38#include "llfloater.h"
39#include "llstatview.h"
40#include "llscrollcontainer.h"
41
42const S32 LL_SCROLL_BORDER = 1;
43
44LLFloaterStats::LLFloaterStats(const LLRect& rect)
45 : LLFloater("floater_stats", rect, "Statistics", TRUE, rect.getWidth())
46
47{
48 LLRect stats_rect(0, rect.getHeight() - LLFLOATER_HEADER_SIZE,
49 rect.getWidth() - LLFLOATER_CLOSE_BOX_SIZE, 0);
50 mStatsContainer = new LLContainerView("statistics_view", stats_rect);
51 mStatsContainer->showLabel(FALSE);
52
53 LLRect scroll_rect(LL_SCROLL_BORDER, rect.getHeight() - LLFLOATER_HEADER_SIZE - LL_SCROLL_BORDER,
54 rect.getWidth() - LL_SCROLL_BORDER, LL_SCROLL_BORDER);
55 mScrollContainer = new LLScrollableContainerView("statistics_scroll", scroll_rect, mStatsContainer);
56 mScrollContainer->setFollowsAll();
57 mScrollContainer->setReserveScrollCorner(TRUE);
58
59 mStatsContainer->setScrollContainer(mScrollContainer);
60
61 addChild(mScrollContainer);
62}
63
64
65LLFloaterStats::~LLFloaterStats()
66{
67}
68
69void LLFloaterStats::reshape(S32 width, S32 height)
70{
71 LLRect rect = mStatsContainer->getRect();
72
73 mStatsContainer->reshape(rect.getWidth() - 2, rect.getHeight(), TRUE);
74
75 LLFloater::reshape(width, height);
76}
77
78
79void LLFloaterStats::addStatView(LLStatView* stat)
80{
81 mStatsContainer->addChildAtEnd(stat);
82}
83
84void LLFloaterStats::onClose(bool app_quitting)
85{
86 setVisible(FALSE);
87}