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


C++ LLIconCtrl::setOrigin方法代码示例

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


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

示例1: addNewItem

void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
	LLAvatarListItem* item = new LLAvatarListItem();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
	item->setRlvCheckShowNames(mRlvCheckShowNames);
// [/RLVa:KB]
	
	// AO: Adjust some parameters that need to be changed when we adjust item spacing form the .xml default
	// If you change these, also change setLineHeight()
	if (mItemHeight != 0)
	{
		S32 width = item->getRect().getWidth();
		item->reshape(width,mItemHeight);
		LLIconCtrl* highlight = item->getChild<LLIconCtrl>("hovered_icon");
		LLIconCtrl* select = item->getChild<LLIconCtrl>("selected_icon");
		highlight->setOrigin(0,24-mItemHeight); // temporary hack to be in the right ballpark.
		highlight->reshape(width,mItemHeight);
		select->setOrigin(0,24-mItemHeight);
		select->reshape(width,mItemHeight);
	}
	
	// This sets the name as a side effect
	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
	item->setOnline(mIgnoreOnlineStatus ? true : is_online);
	item->showLastInteractionTime(mShowLastInteractionTime);

	item->setAvatarIconVisible(mShowIcons);
	item->setShowInfoBtn(mShowInfoBtn);
	item->setShowVoiceVolume(mShowVoiceVolume);
	item->setShowProfileBtn(mShowProfileBtn);
	item->showSpeakingIndicator(mShowSpeakingIndicator);
	item->setShowPermissions(mShowPermissions);
	item->showUsername(mShowUsername);
	item->showDisplayName(mShowDisplayName);
	item->showRange(mShowRange);
	item->showFirstSeen(mShowFirstSeen);
	item->showStatusFlags(mShowStatusFlags);
	item->showPaymentStatus(mShowPaymentStatus);
	item->showAvatarAge(mShowAge);
	
	// [Ansariel: Colorful radar]
	item->setUseRangeColors(mUseRangeColors);
	LLUIColorTable* colorTable = &LLUIColorTable::instance();
	item->setShoutRangeColor(colorTable->getColor("AvatarListItemShoutRange", LLColor4::yellow));
	item->setBeyondShoutRangeColor(colorTable->getColor("AvatarListItemBeyondShoutRange", LLColor4::red));
	// [/Ansariel: Colorful radar]

	item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoubleClicked, this, _1, _2, _3, _4));

	addItem(item, id, pos);
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:51,代码来源:llavatarlist.cpp

示例2: setItemHeight

void LLAvatarList::setItemHeight(S32 height)
// AO: Adjust some parameters that need to be changed when we adjust item spacing form the .xml default
// If you change these, also change addNewItem()
{
	mItemHeight = height;
	std::vector<LLPanel*> items;
	getItems(items);
	for(std::vector<LLPanel*>::const_iterator it = items.begin(), end_it = items.end(); it != end_it; ++it)
	{
		LLAvatarListItem* avItem = static_cast<LLAvatarListItem*>(*it);
		if (mItemHeight != 0)
		{
			S32 width = avItem->getRect().getWidth();
			avItem->reshape(width,mItemHeight);
			LLIconCtrl* highlight = avItem->getChild<LLIconCtrl>("hovered_icon");
			LLIconCtrl* select = avItem->getChild<LLIconCtrl>("selected_icon");
			highlight->setOrigin(0,24-height); // temporary hack to be in the right ballpark.
			highlight->reshape(width,mItemHeight);
			select->setOrigin(0,24-height);
			select->reshape(width,mItemHeight);
		}
	}
	mNeedUpdateNames = true;
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:24,代码来源:llavatarlist.cpp


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