llfloaterstats.cpp

Go to the documentation of this file.
00001 
00034 #include "llviewerprecompiledheaders.h"
00035 
00036 #include "llfloaterstats.h"
00037 #include "llcontainerview.h"
00038 #include "llfloater.h"
00039 #include "llstatview.h"
00040 #include "llscrollcontainer.h"
00041 
00042 const S32 LL_SCROLL_BORDER = 1;
00043 
00044 LLFloaterStats::LLFloaterStats(const LLRect& rect)
00045         :   LLFloater("floater_stats", rect, "Statistics", TRUE, rect.getWidth())
00046 
00047 {
00048         LLRect stats_rect(0, rect.getHeight() - LLFLOATER_HEADER_SIZE,
00049                                         rect.getWidth() - LLFLOATER_CLOSE_BOX_SIZE, 0);
00050         mStatsContainer = new LLContainerView("statistics_view", stats_rect);
00051         mStatsContainer->showLabel(FALSE);
00052 
00053         LLRect scroll_rect(LL_SCROLL_BORDER, rect.getHeight() - LLFLOATER_HEADER_SIZE - LL_SCROLL_BORDER,
00054                                            rect.getWidth() - LL_SCROLL_BORDER, LL_SCROLL_BORDER);
00055                 mScrollContainer = new LLScrollableContainerView("statistics_scroll", scroll_rect, mStatsContainer);
00056         mScrollContainer->setFollowsAll();
00057         mScrollContainer->setReserveScrollCorner(TRUE);
00058 
00059         mStatsContainer->setScrollContainer(mScrollContainer);
00060         
00061         addChild(mScrollContainer);
00062 }
00063 
00064 
00065 LLFloaterStats::~LLFloaterStats()
00066 {
00067 }
00068 
00069 void LLFloaterStats::reshape(S32 width, S32 height)
00070 {
00071         LLRect rect = mStatsContainer->getRect();
00072 
00073         mStatsContainer->reshape(rect.getWidth() - 2, rect.getHeight(), TRUE);
00074 
00075         LLFloater::reshape(width, height);
00076 }
00077 
00078 
00079 void LLFloaterStats::addStatView(LLStatView* stat)
00080 {
00081         mStatsContainer->addChildAtEnd(stat);
00082 }
00083 
00084 void LLFloaterStats::onClose(bool app_quitting)
00085 {
00086         setVisible(FALSE);
00087 }

Generated on Fri May 16 08:33:31 2008 for SecondLife by  doxygen 1.5.5