本文整理汇总了C++中LLTextBox::setRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextBox::setRect方法的具体用法?C++ LLTextBox::setRect怎么用?C++ LLTextBox::setRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextBox
的用法示例。
在下文中一共展示了LLTextBox::setRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------------
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->setRect(text_rect);
}
示例2: LLRect
LLFloaterTestImpl::LLFloaterTestImpl()
: LLFloater(std::string("test"), LLRect(0, 500, 700, 0), std::string("Test UI"))
{
const S32 HPAD = 5;
const S32 VPAD = 5;
const S32 LEFT = HPAD;
const S32 RIGHT = getRect().getWidth() - HPAD;
const S32 TOP = getRect().getHeight() - LLFLOATER_HEADER_SIZE - VPAD;
const S32 BOTTOM = VPAD;
const S32 LINE = 15;
//S32 x = LEFT;
S32 y = TOP;
LLTextBox* text = NULL;
LLButton* btn = NULL;
LLTabContainer* tab = NULL;
LLPanel* panel = NULL;
LLCheckBoxCtrl* check = NULL;
LLComboBox* combo = NULL;
btn = new LLButton(std::string("can't click"),
LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
LLStringUtil::null,
boost::bind(&LLFloaterTestImpl::onClickButton));
btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
btn->setFont(LLFontGL::getFontSansSerifSmall());
addChild(btn);
text = new LLTextBox(std::string("simple_text"),
std::string("simple sans-serif text that is mouse opaque opaque opaque"),
50, // max_width
LLFontGL::getFontSansSerifSmall(),
TRUE); // mouse_opaque
text->setClickedCallback(boost::bind(&onClickText));
text->setRect(LLRect(LEFT, y, RIGHT, y-LINE));
addChild(text);
y -= VPAD + LINE;
btn = new LLButton(std::string("can click"),
LLRect(LEFT+150, y, LEFT+150+100, y-LINE),
LLStringUtil::null,
boost::bind(&LLFloaterTestImpl::onClickButton));
btn->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
btn->setFont(LLFontGL::getFontSansSerifSmall());
addChild(btn);
text = new LLTextBox(std::string("simple2_text"),
LLRect(LEFT, y, RIGHT, y-LINE),
std::string("monospaced, non-opaque text with tooltip, non-opaque non-opaque"),
LLFontGL::getFontMonospace(),
FALSE); // mouse_opaque
text->setToolTip(std::string("I'm a tooltip"));
addChild(text);
y -= VPAD + LINE;
tab = new LLTabContainer(std::string("test_tab"),
LLRect(LEFT, y, RIGHT, BOTTOM),
LLTabContainer::TOP,
TRUE, // bordered
FALSE); // horizontal
addChild(tab);
mTab = tab;
tab->setCommitCallback(boost::bind(&LLFloaterTestImpl::onClickTab));
//-----------------------------------------------------------------------
// First tab container panel
//-----------------------------------------------------------------------
panel = new LLPanel(std::string("first_tab_panel"),
LLRect(0, 400, 400, 0), // dummy rect
TRUE); // bordered
tab->addTabPanel(panel, std::string("First"),
TRUE); // select
y = panel->getRect().getHeight() - VPAD;
text = new LLTextBox(std::string("unicode_text"),
LLRect(LEFT, y, RIGHT, y-LINE),
std::string("File"),
LLFontGL::getFontSansSerif(),
TRUE); // mouse_opaque
text->setToolTip(std::string("This should be Unicode text"));
panel->addChild(text);
y -= VPAD + LINE;
btn = new LLButton(std::string("unicode_btn"), LLRect(LEFT, y, LEFT+100, y-20));
btn->setLabel(std::string("unicode"));
panel->addChild(btn);
y -= VPAD + 20;
btn = new LLButton(std::string("image_btn"),
LLRect(LEFT, y, LEFT+32, y-32),
std::string("tool_zoom.tga"),
std::string("tool_zoom_active.tga"),
LLStringUtil::null,
//.........这里部分代码省略.........