本文整理汇总了C++中LLTextBox类的典型用法代码示例。如果您正苦于以下问题:C++ LLTextBox类的具体用法?C++ LLTextBox怎么用?C++ LLTextBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLTextBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: snapToMessageHeight
void LLToastScriptQuestion::snapToMessageHeight()
{
LLTextBox* mMessage = getChild<LLTextBox>("top_info_message");
LLTextBox* mFooter = getChild<LLTextBox>("bottom_info_message");
if (!mMessage || !mFooter)
{
return;
}
if (mMessage->getVisible() && mFooter->getVisible())
{
S32 heightDelta = 0;
S32 maxTextHeight = (mMessage->getDefaultFont()->getLineHeight() * MAX_LINES_COUNT)
+ (mFooter->getDefaultFont()->getLineHeight() * MAX_LINES_COUNT);
LLRect messageRect = mMessage->getRect();
LLRect footerRect = mFooter->getRect();
S32 oldTextHeight = messageRect.getHeight() + footerRect.getHeight();
S32 requiredTextHeight = mMessage->getTextBoundingRect().getHeight() + mFooter->getTextBoundingRect().getHeight();
S32 newTextHeight = llmin(requiredTextHeight, maxTextHeight);
heightDelta = newTextHeight - oldTextHeight - heightDelta;
reshape( getRect().getWidth(), llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT));
}
}
示例2: childSetAction
BOOL LLVoiceRemoteCtrl::postBuild()
{
mTalkBtn = getChild<LLButton>("push_to_talk");
mTalkBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkClicked));
mTalkBtn->setHeldDownCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkHeld));
mTalkBtn->setMouseUpCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkReleased));
mTalkLockBtn = getChild<LLButton>("ptt_lock");
mTalkLockBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnLock,this));
mSpeakersBtn = getChild<LLButton>("speakers_btn");
mSpeakersBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickSpeakers));
childSetAction("show_channel", onClickPopupBtn, this);
childSetAction("end_call_btn", onClickEndCall, this);
LLTextBox* text = getChild<LLTextBox>("channel_label");
if (text)
{
text->setUseEllipses(TRUE);
}
childSetAction("voice_channel_bg", onClickVoiceChannel, this);
mEndCallBtn.connect(this,"end_call_btn");
mVoiceVolIcon.connect(this,"voice_volume");
mVoiceChanIcon.connect(this,"voice_channel_icon");
mVoiceChanBgBtn.connect(this,"voice_channel_bg");
mChanLabelTextBox.connect(this,"channel_label");
mShowChanBtn.connect(this,"show_channel");
return TRUE;
}
示例3: childSetAction
BOOL LLVoiceRemoteCtrl::postBuild()
{
mTalkBtn = getChild<LLButton>("push_to_talk");
mTalkBtn->setClickedCallback(onBtnTalkClicked);
mTalkBtn->setHeldDownCallback(onBtnTalkHeld);
mTalkBtn->setMouseUpCallback(onBtnTalkReleased);
mTalkLockBtn = getChild<LLButton>("ptt_lock");
mTalkLockBtn->setClickedCallback(onBtnLock);
mTalkLockBtn->setCallbackUserData(this);
mSpeakersBtn = getChild<LLButton>("speakers_btn");
mSpeakersBtn->setClickedCallback(onClickSpeakers);
mSpeakersBtn->setCallbackUserData(this);
childSetAction("show_channel", onClickPopupBtn, this);
childSetAction("end_call_btn", onClickEndCall, this);
LLTextBox* text = getChild<LLTextBox>("channel_label");
if (text)
{
text->setUseEllipses(TRUE);
}
childSetAction("voice_channel_bg", onClickVoiceChannel, this);
return TRUE;
}
示例4: updateCovenantText
void LLFloaterBuyLandUI::updateCovenantText(const std::string &string, const LLUUID& asset_id)
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");
if (editor)
{
editor->setHandleEditKeysDirectly(FALSE);
editor->setText(string);
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
LLTextBox* box = getChild<LLTextBox>("covenant_text");
if(check && box)
{
if (asset_id.isNull())
{
check->set(true);
check->setEnabled(false);
refreshUI();
// remove the line stating that you must agree
box->setVisible(FALSE);
}
else
{
check->setEnabled(true);
// remove the line stating that you must agree
box->setVisible(TRUE);
}
}
}
}
示例5: showInfoCtrl
void showInfoCtrl()
{
if (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) return;
if (!sInfoCtrl)
{
// *TODO: Delete the button at exit.
sInfoCtrl = LLUICtrlFactory::createFromFile<LLUICtrl>("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance());
if (sInfoCtrl)
{
sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl));
}
}
if (!sInfoCtrl)
{
llassert(sInfoCtrl != NULL);
return;
}
LLTextBox* name = getChild<LLTextBox>("user_name");
LLRect sticky_rect = name->getRect();
S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ;
addChild(sInfoCtrl);
}
示例6: updateCovenantInfo
void LLFloaterBuyLandUI::updateCovenantInfo()
{
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if(!region) return;
LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
if (region_name)
{
region_name->setText(region->getName());
}
LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
if (resellable_clause)
{
if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
{
resellable_clause->setText(getString("can_not_resell"));
}
else
{
resellable_clause->setText(getString("can_resell"));
}
}
LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause");
if (changeable_clause)
{
if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
{
changeable_clause->setText(getString("can_change"));
}
else
{
changeable_clause->setText(getString("can_not_change"));
}
}
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
if(check)
{
check->set(false);
check->setEnabled(true);
check->setCallbackUserData(this);
check->setCommitCallback(onChangeAgreeCovenant);
}
LLTextBox* box = getChild<LLTextBox>("covenant_text");
if(box)
{
box->setVisible(FALSE);
}
// send EstateCovenantInfo message
LLMessageSystem *msg = gMessageSystem;
msg->newMessage("EstateCovenantRequest");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
msg->sendReliable(region->getHost());
}
示例7: childSetActionTextbox
void LLPanel::childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value)
{
LLTextBox* textbox = findChild<LLTextBox>(id);
if (textbox)
{
textbox->setClickedCallback(boost::bind(function, value));
}
}
示例8:
//---------------------------------------------------------------------------------
void LLIMWellWindow::RowPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param)
{
LLTextBox* text = getChild<LLTextBox>("contact_name");
S32 new_text_left = mChiclet->getRect().mRight + CHICLET_HPAD;
LLRect text_rect = text->getRect();
text_rect.mLeft = new_text_left;
text->setShape(text_rect);
}
示例9: void
void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value)
{
LLTextBox* textbox = getChild<LLTextBox>(id);
if (textbox)
{
textbox->setClickedCallback(function, value);
}
}
示例10: childSetWrappedText
void LLPanel::childSetWrappedText(const std::string& id, const std::string& text, bool visible)
{
LLTextBox* child = getChild<LLTextBox>(id);
if (child)
{
child->setVisible(visible);
child->setWrappedText(text);
}
}
示例11: setText
void LLViewChildren::setText(
const std::string& id, const std::string& text, bool visible)
{
LLTextBox* child = mParent.getChild<LLTextBox>(id);
if (child)
{
child->setVisible(visible);
child->setText(text);
}
}
示例12: updateDescription
void LLInspectObject::updateDescription(LLSelectNode* nodep)
{
const char* const DEFAULT_DESC = "(No Description)";
std::string desc;
if (!nodep->mDescription.empty()
&& nodep->mDescription != DEFAULT_DESC)
{
desc = nodep->mDescription;
}
LLTextBox* textbox = getChild<LLTextBox>("object_description");
textbox->setValue(desc);
}
示例13: LLTextBox
void LLDragHandleTop::setTitle(const std::string& title)
{
std::string trimmed_title = title;
LLStringUtil::trim(trimmed_title);
const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF );
LLTextBox* titlebox = new LLTextBox( std::string("Drag Handle Title"), getRect(), trimmed_title, font );
titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT);
titlebox->setFontShadow(LLFontGL::DROP_SHADOW_SOFT);
setTitleBox(titlebox);
reshapeTitleBox();
}
示例14: createButtons
BOOL LLToastScriptQuestion::postBuild()
{
createButtons();
LLTextBox* mMessage = getChild<LLTextBox>("top_info_message");
LLTextBox* mFooter = getChild<LLTextBox>("bottom_info_message");
mMessage->setValue(mNotification->getMessage());
mFooter->setValue(mNotification->getFooter());
snapToMessageHeight();
return TRUE;
}
示例15: LLPanel
//---------------------------------------------------------------------------------
LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& sessionId,
S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) :
LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent)
{
buildFromFile( "panel_activeim_row.xml", NULL);
// Choose which of the pre-created chiclets (IM/group) to use.
// The other one gets hidden.
LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(sessionId);
switch (im_chiclet_type)
{
case LLIMChiclet::TYPE_GROUP:
mChiclet = getChild<LLIMGroupChiclet>("group_chiclet");
break;
case LLIMChiclet::TYPE_AD_HOC:
mChiclet = getChild<LLAdHocChiclet>("adhoc_chiclet");
break;
case LLIMChiclet::TYPE_UNKNOWN: // assign mChiclet a non-null value anyway
case LLIMChiclet::TYPE_IM:
mChiclet = getChild<LLIMP2PChiclet>("p2p_chiclet");
break;
}
// Initialize chiclet.
mChiclet->setChicletSizeChangedCallback(boost::bind(&LLIMWellWindow::RowPanel::onChicletSizeChanged, this, mChiclet, _2));
mChiclet->enableCounterControl(true);
mChiclet->setCounter(chicletCounter);
mChiclet->setSessionId(sessionId);
mChiclet->setIMSessionName(name);
mChiclet->setOtherParticipantId(otherParticipantId);
mChiclet->setVisible(true);
if (im_chiclet_type == LLIMChiclet::TYPE_IM)
{
LLAvatarNameCache::get(otherParticipantId,
boost::bind(&LLIMWellWindow::RowPanel::onAvatarNameCache,
this, _1, _2));
}
else
{
LLTextBox* contactName = getChild<LLTextBox>("contact_name");
contactName->setValue(name);
}
mCloseBtn = getChild<LLButton>("hide_btn");
mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::RowPanel::onClosePanel, this));
}