本文整理汇总了C++中LLIconCtrl::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLIconCtrl::setValue方法的具体用法?C++ LLIconCtrl::setValue怎么用?C++ LLIconCtrl::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLIconCtrl
的用法示例。
在下文中一共展示了LLIconCtrl::setValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->setValue(std::string("badge_ok.j2c")); break;
case BADGE_NOTE: child->setValue(std::string("badge_note.j2c")); break;
case BADGE_WARN: child->setValue(std::string("badge_warn.j2c")); break;
case BADGE_ERROR: child->setValue(std::string("badge_error.j2c")); break;
}
}
}
示例2: 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 || LLVoiceClient::getInstance()->getUserPTTState());
}
mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD()));
mTalkLockBtn->setToggleState(!ptt_currently_enabled);
std::string talk_blip_image;
if (LLVoiceClient::getInstance()->getIsSpeaking(gAgent.getID()))
{
F32 voice_power = LLVoiceClient::getInstance()->getCurrentPower(gAgent.getID());
if (voice_power > LLVoiceClient::OVERDRIVEN_POWER_LEVEL)
{
talk_blip_image = "icn_voice_ptt-on-lvl3.tga";
}
else
{
F32 power = LLVoiceClient::getInstance()->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->setValue(talk_blip_image);
}
LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater();
LLVoiceChannel* current_channel = LLVoiceChannel::getCurrentVoiceChannel();
if (!voice_floater) // Maybe it's undocked
{
voice_floater = gIMMgr->findFloaterBySession(current_channel->getSessionID());
}
std::string active_channel_name;
if (voice_floater)
{
active_channel_name = voice_floater->getShortTitle();
}
if (LLButton* end_call_btn = findChild<LLButton>("end_call_btn"))
end_call_btn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled()
&& current_channel
&& current_channel->isActive()
&& current_channel != LLVoiceChannelProximal::getInstance());
mPosLockBtn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled()
&& current_channel
&& current_channel->isActive());
mPosLockBtn->setToggleState(LLVivoxVoiceClient::getInstance()->getPosLocked());
mPosLockToCamBtn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled()
&& current_channel
&& current_channel->isActive());
mPosLockToCamBtn->setToggleState(LLVivoxVoiceClient::getInstance()->getPosLockedToCam());
if (LLTextBox* text = findChild<LLTextBox>("channel_label"))
text->setValue(active_channel_name);
LLButton* voice_channel_bg = findChild<LLButton>("voice_channel_bg");
if (voice_channel_bg) voice_channel_bg->setToolTip(active_channel_name);
if (current_channel)
{
LLIconCtrl* voice_channel_icon = findChild<LLIconCtrl>("voice_channel_icon");
if (voice_channel_icon && voice_floater)
{
voice_channel_icon->setValue(voice_floater->getString("voice_icon"));
}
//.........这里部分代码省略.........