Пример #1
0
LLFloaterMap::LLFloaterMap(const std::string& name)
	:
	LLFloater(name, 
				"FloaterMapRect", 
				MAP_TITLE, 
				TRUE, 
				FLOATERMAP_MIN_WIDTH, 
				FLOATERMAP_MIN_HEIGHT_LARGE, 
				FALSE, 
				FALSE, 
				TRUE)	// close button
{
	const S32 LEFT = LLPANEL_BORDER_WIDTH;
	const S32 TOP = mRect.getHeight();

	S32 y = 0;

	// Map itself
	LLRect map_rect(
		LEFT, 
		TOP - LLPANEL_BORDER_WIDTH,
		mRect.getWidth() - LLPANEL_BORDER_WIDTH,
		y );
	LLColor4 bg_color = gColors.getColor( "NetMapBackgroundColor" );
	mMap = new LLNetMap("Net Map", map_rect, bg_color);
	mMap->setFollowsAll();
	addChildAtEnd(mMap);

	// Get the drag handle all the way in back
	removeChild(mDragHandle);
	addChildAtEnd(mDragHandle);

	setIsChrome(TRUE);
}
Пример #2
0
void LLScrollingPanelList::addPanel( LLScrollingPanel* panel )
{
	addChildAtEnd( panel );
	mPanelList.push_front( panel );
	
	const S32 GAP_BETWEEN_PANELS = 6;

	// Resize this view
	S32 total_height = 0;
	S32 max_width = 0;
	S32 cur_gap = 0;
	for (std::deque<LLScrollingPanel*>::iterator iter = mPanelList.begin();
		 iter != mPanelList.end(); ++iter)
	{
		LLScrollingPanel *childp = *iter;
		total_height += childp->getRect().getHeight() + cur_gap;
		max_width = llmax( max_width, childp->getRect().getWidth() );
		cur_gap = GAP_BETWEEN_PANELS;
	}
	reshape( max_width, total_height, FALSE );

	// Reposition each of the child views
	S32 cur_y = total_height;
	for (std::deque<LLScrollingPanel*>::iterator iter = mPanelList.begin();
		 iter != mPanelList.end(); ++iter)
	{
		LLScrollingPanel *childp = *iter;
		cur_y -= childp->getRect().getHeight();
		childp->translate( -childp->getRect().mLeft, cur_y - childp->getRect().mBottom);
		cur_y -= GAP_BETWEEN_PANELS;
	}
}
Пример #3
0
LLStatView *LLStatView::addStatView(const std::string& name, const std::string& label, const std::string& setting, const LLRect& rect)
{
	LLStatView *statview = new LLStatView(name, label, setting, rect);
	statview->setVisible(mDisplayChildren);
	addChildAtEnd(statview);
	return statview;
}
Пример #4
0
LLStatBar *LLStatView::addStat(const std::string& name, LLStat *statp,
							   const std::string& setting, BOOL default_bar, BOOL default_history)
{
	LLStatBar *stat_barp;
	LLRect r;

//	if (getStatBar(name))
//	{
//		llinfos << "LLStatView::addStat - Stat already exists!" << llendl;
//		return NULL;
//	}

	mNumStatBars++;

	stat_barp = new LLStatBar(name, r, setting, default_bar, default_history);
	stat_barp->mStatp = statp;

	stat_barp->setVisible(mDisplayChildren);
	addChildAtEnd(stat_barp);
	mStatBars.push_back(stat_barp);

	// Rearrange all child bars.
	reshape(getRect().getWidth(), getRect().getHeight());
	return stat_barp;
}