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


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

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


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

示例1: setBadge

void LLViewChildren::setBadge(const std::string& id, Badge badge, bool visible)
{
	LLIconCtrl* child = mParent.getChild<LLIconCtrl>(id);
	if (child)
	{
		child->setVisible(visible);
		switch (badge)
		{
			default:
			case BADGE_OK:		child->setImage(std::string("badge_ok.j2c"));	break;
			case BADGE_NOTE:	child->setImage(std::string("badge_note.j2c"));	break;
			case BADGE_WARN:	child->setImage(std::string("badge_warn.j2c"));	break;
			case BADGE_ERROR:	child->setImage(std::string("badge_error.j2c"));	break;
		}
	}
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:16,代码来源:llviewchildren.cpp

示例2: draw

void LLVoiceRemoteCtrl::draw()
{
	BOOL voice_active = FALSE;
	LLVoiceChannel* channelp = LLVoiceChannel::getCurrentVoiceChannel();
	if (channelp)
	{
		voice_active = channelp->isActive();
	}

	mTalkBtn->setEnabled(voice_active);
	mPosLockBtn->setEnabled(voice_active);
	mTalkLockBtn->setEnabled(voice_active);

	// propagate ptt state to button display,
	if (!mTalkBtn->hasMouseCapture())
	{
		// not in push to talk mode, or push to talk is active means I'm talking
		mTalkBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled") || gVoiceClient->getUserPTTState());
	}
	mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD()));
	mPosLockBtn->setToggleState(gVoiceClient->getPosLocked());
	mTalkLockBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled"));
	

	std::string talk_blip_image;
	if (gVoiceClient->getIsSpeaking(gAgent.getID()))
	{
		F32 voice_power = gVoiceClient->getCurrentPower(gAgent.getID());

		if (voice_power > LLVoiceClient::OVERDRIVEN_POWER_LEVEL)
		{
			talk_blip_image = "icn_voice_ptt-on-lvl3.tga";
		}
		else
		{
			F32 power = gVoiceClient->getCurrentPower(gAgent.getID());
			S32 icon_image_idx = llmin(2, llfloor((power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f));

			switch(icon_image_idx)
			{
			case 0:
				talk_blip_image = "icn_voice_ptt-on.tga";
				break;
			case 1:
				talk_blip_image = "icn_voice_ptt-on-lvl1.tga";
				break;
			case 2:
				talk_blip_image = "icn_voice_ptt-on-lvl2.tga";
				break;
			}
		}
	}
	else
	{
		talk_blip_image = "icn_voice_ptt-off.tga";
	}

	LLIconCtrl* icon = getChild<LLIconCtrl>("voice_volume");
	if (icon)
	{
		icon->setImage(talk_blip_image);
	}

	LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater();
	std::string active_channel_name;
	if (voice_floater)
	{
		active_channel_name = voice_floater->getShortTitle();
	}

	LLVoiceChannel* current_channel = LLVoiceChannel::getCurrentVoiceChannel();
	childSetEnabled("end_call_btn", LLVoiceClient::voiceEnabled() 
								&& current_channel
								&& current_channel->isActive()
								&& current_channel != LLVoiceChannelProximal::getInstance());



	LLButton* expand_button = getChild<LLButton>("show_channel");
	if (expand_button)
	{
		if (expand_button->getToggleState())
		{
			expand_button->setImageOverlay(std::string("arrow_down.tga"));
		}
		else
		{
			expand_button->setImageOverlay(std::string("arrow_up.tga"));
		}
	}

	LLPanel::draw();
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:93,代码来源:llvoiceremotectrl.cpp

示例3: draw

void LLVoiceRemoteCtrl::draw()
{
	BOOL voice_active = FALSE;
	LLVoiceChannel* channelp = LLVoiceChannel::getCurrentVoiceChannel();
	if (channelp)
	{
		voice_active = channelp->isActive();
	}

	mTalkBtn->setEnabled(voice_active);
	mTalkLockBtn->setEnabled(voice_active);

	static LLCachedControl<bool> ptt_currently_enabled("PTTCurrentlyEnabled",false);
	// propagate ptt state to button display,
	if (!mTalkBtn->hasMouseCapture())
	{
		// not in push to talk mode, or push to talk is active means I'm talking
		mTalkBtn->setToggleState(!ptt_currently_enabled || gVoiceClient->getUserPTTState());
	}
	mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD()));
	mTalkLockBtn->setToggleState(!ptt_currently_enabled);

	std::string talk_blip_image;
	if (gVoiceClient->getIsSpeaking(gAgent.getID()))
	{
		F32 voice_power = gVoiceClient->getCurrentPower(gAgent.getID());

		if (voice_power > LLVoiceClient::OVERDRIVEN_POWER_LEVEL)
		{
			talk_blip_image = "icn_voice_ptt-on-lvl3.tga";
		}
		else
		{
			F32 power = gVoiceClient->getCurrentPower(gAgent.getID());
			S32 icon_image_idx = llmin(2, llfloor((power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f));

			switch(icon_image_idx)
			{
			case 0:
				talk_blip_image = "icn_voice_ptt-on.tga";
				break;
			case 1:
				talk_blip_image = "icn_voice_ptt-on-lvl1.tga";
				break;
			case 2:
				talk_blip_image = "icn_voice_ptt-on-lvl2.tga";
				break;
			}
		}
	}
	else
	{
		talk_blip_image = "icn_voice_ptt-off.tga";
	}

	LLIconCtrl* icon = mVoiceVolIcon;
	if (icon)
	{
		icon->setImage(talk_blip_image);
	}

	LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater();
	std::string active_channel_name;
	if (voice_floater)
	{
		active_channel_name = voice_floater->getShortTitle();
	}

	LLVoiceChannel* current_channel = LLVoiceChannel::getCurrentVoiceChannel();
	mEndCallBtn->setEnabled(LLVoiceClient::voiceEnabled() 
								&& current_channel
								&& current_channel->isActive()
								&& current_channel != LLVoiceChannelProximal::getInstance());

	mChanLabelTextBox->setValue(active_channel_name);
	mVoiceChanBgBtn->setToolTip(active_channel_name);

	if (current_channel)
	{
		LLIconCtrl* voice_channel_icon = mVoiceChanIcon;
		if (voice_channel_icon && voice_floater)
		{
			voice_channel_icon->setImage(voice_floater->getString("voice_icon"));
		}

		LLButton* voice_channel_bg = mVoiceChanBgBtn;
		if (voice_channel_bg)
		{
			LLColor4 bg_color;
			if (current_channel->isActive())
			{
				bg_color = lerp(LLColor4::green, LLColor4::white, 0.7f);
			}
			else if (current_channel->getState() == LLVoiceChannel::STATE_ERROR)
			{
				bg_color = lerp(LLColor4::red, LLColor4::white, 0.7f);
			}
			else // active, but not connected
			{
				bg_color = lerp(LLColor4::yellow, LLColor4::white, 0.7f);
//.........这里部分代码省略.........
开发者ID:Krazy-Bish-Margie,项目名称:SingularityViewer,代码行数:101,代码来源:llvoiceremotectrl.cpp


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