当前位置: 首页>>代码示例>>C++>>正文


C++ LLFloater::getRect方法代码示例

本文整理汇总了C++中LLFloater::getRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloater::getRect方法的具体用法?C++ LLFloater::getRect怎么用?C++ LLFloater::getRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLFloater的用法示例。


在下文中一共展示了LLFloater::getRect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getLastFloaterCascading

LLFloater* LLFloaterReg::getLastFloaterCascading()
{
	LLRect candidate_rect;
	candidate_rect.mTop = 100000;
	LLFloater* candidate_floater = NULL;

	std::map<std::string,std::string>::const_iterator it = sGroupMap.begin(), it_end = sGroupMap.end();
	for( ; it != it_end; ++it)
	{
		const std::string& group_name = it->second;

		instance_list_t& instances = sInstanceMap[group_name];

		for (instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); ++iter)
		{
			LLFloater* inst = *iter;

			if (inst->getVisible() 
				&& (inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING)
					|| inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADE_GROUP)))
			{
				if (candidate_rect.mTop > inst->getRect().mTop)
				{
					candidate_floater = inst;
					candidate_rect = inst->getRect();
				}
			}
		}
	}

	return candidate_floater;
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:32,代码来源:llfloaterreg.cpp

示例2: getInstance

//static
LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) 
{
	LLFloater* res = findInstance(name, key);
	if (!res)
	{
		const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc;
		const std::string& xui_file = sBuildMap[name].mFile;
		if (build_func)
		{
			const std::string& groupname = sGroupMap[name];
			if (!groupname.empty())
			{
				instance_list_t& list = sInstanceMap[groupname];
				int index = list.size();

				res = build_func(key);
				
				bool success = res->buildFromFile(xui_file, NULL);
				if (!success)
				{
					llwarns << "Failed to build floater type: '" << name << "'." << llendl;
					return NULL;
				}
					
				// Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe
				res->mKey = key;
				res->setInstanceName(name);
				res->applySavedVariables(); // Can't apply rect and dock state until setting instance name
				if (res->mAutoTile && !res->getHost() && index > 0)
				{
					const LLRect& cur_rect = res->getRect();
					LLRect next_rect = getFloaterRect(groupname);
					next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, cur_rect.getWidth(), cur_rect.getHeight());
					res->setRect(next_rect);
					res->setRectControl(LLStringUtil::null); // don't save rect of tiled floaters
					gFloaterView->adjustToFitScreen(res, true);
				}
				else
				{
					gFloaterView->adjustToFitScreen(res, false);
				}
				list.push_back(res);
			}
		}
		if (!res)
		{
			llwarns << "Floater type: '" << name << "' not registered." << llendl;
		}
	}
	return res;
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:52,代码来源:llfloaterreg.cpp

示例3: getInstance

//static
LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) 
{
	LLFloater* res = findInstance(name, key);
	if (!res)
	{
		const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc;
		const std::string& xui_file = sBuildMap[name].mFile;
		if (build_func)
		{
			const std::string& groupname = sGroupMap[name];
			if (!groupname.empty())
			{
				instance_list_t& list = sInstanceMap[groupname];
				int index = list.size();

				res = build_func(key);
				
				bool success = res->buildFromFile(xui_file, NULL);
				if (!success)
				{
					llwarns << "Failed to build floater type: '" << name << "'." << llendl;
					return NULL;
				}
					
				// Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe
				res->mKey = key;
				res->setInstanceName(name);
				
				// AO: Mark certain floaters (sidebar tab floaters) as needing to be pseudo-hidden on minimization.
				// At the moment we flag this pseudo hiding with the presence of a dummy control in floater_side_bar_tab.xml
				// and the name of the floater window. This should be refactored into a floater attribute.
				llinfos << "trying to restore variables for name: " << name << llendl;
				std::string pat = "side_bar_tab";
				size_t found = name.find(pat);
				if (found!=std::string::npos)
				{
					if (!res->hasChild("showMinimized"))
						res->setHideOnMinimize(true);
				}
				
				res->applySavedVariables(); // Can't apply rect and dock state until setting instance name
				if (res->mAutoTile && !res->getHost() && index > 0)
				{
					const LLRect& cur_rect = res->getRect();
					LLRect next_rect = getFloaterRect(groupname);
					next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, cur_rect.getWidth(), cur_rect.getHeight());
					res->setRect(next_rect);
					res->setRectControl(LLStringUtil::null); // don't save rect of tiled floaters
					gFloaterView->adjustToFitScreen(res, true);
				}
				else
				{
					gFloaterView->adjustToFitScreen(res, false);
				}
				list.push_back(res);
			}
		}
		if (!res)
		{
			llwarns << "Floater type: '" << name << "' not registered." << llendl;
		}
	}
	return res;
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:65,代码来源:llfloaterreg.cpp


注:本文中的LLFloater::getRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。