本文整理汇总了C++中LLUICtrl::getRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUICtrl::getRect方法的具体用法?C++ LLUICtrl::getRect怎么用?C++ LLUICtrl::getRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUICtrl
的用法示例。
在下文中一共展示了LLUICtrl::getRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pointInChild
bool pointInChild(const std::string& name,S32 x,S32 y)
{
LLUICtrl* child = findChild<LLUICtrl>(name);
if(!child)
return false;
LLView* parent = child->getParent();
if(parent!=this)
{
x-=parent->getRect().mLeft;
y-=parent->getRect().mBottom;
}
S32 local_x = x - child->getRect().mLeft ;
S32 local_y = y - child->getRect().mBottom ;
return child->pointInView(local_x, local_y);
}
示例2:
void LLNearbyChatToastPanel::reshape (S32 width, S32 height, BOOL called_from_parent )
{
LLPanel::reshape(width, height,called_from_parent);
LLUICtrl* msg_text = getChild<LLUICtrl>("msg_text", false);
LLUICtrl* icon = getChild<LLUICtrl>("avatar_icon", false);
LLRect msg_text_rect = msg_text->getRect();
LLRect avatar_rect = icon->getRect();
avatar_rect.setLeftTopAndSize(2,height-2,avatar_rect.getWidth(),avatar_rect.getHeight());
icon->setRect(avatar_rect);
msg_text_rect.setLeftTopAndSize( avatar_rect.mRight + msg_left_offset,
height - msg_height_pad,
width - avatar_rect.mRight - msg_left_offset - msg_right_offset,
height - 2*msg_height_pad);
msg_text->reshape( msg_text_rect.getWidth(), msg_text_rect.getHeight(), 1);
msg_text->setRect(msg_text_rect);
}
示例3: reshapeLeftWidgets
void LLPanelInventoryListItemBase::reshapeLeftWidgets()
{
S32 widget_left = 0;
mLeftWidgetsWidth = 0;
widget_array_t::const_iterator it = mLeftSideWidgets.begin();
const widget_array_t::const_iterator it_end = mLeftSideWidgets.end();
for( ; it_end != it; ++it)
{
LLUICtrl* widget = *it;
if(!widget->getVisible())
{
continue;
}
LLRect widget_rect(widget->getRect());
widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight());
widget->setShape(widget_rect);
widget_left += widget_rect.getWidth() + getWidgetSpacing();
mLeftWidgetsWidth = widget_rect.mRight;
}
}
示例4: reshapeRightWidgets
void LLPanelInventoryListItemBase::reshapeRightWidgets()
{
S32 widget_right = getLocalRect().getWidth();
S32 widget_left = widget_right;
widget_array_t::const_reverse_iterator it = mRightSideWidgets.rbegin();
const widget_array_t::const_reverse_iterator it_end = mRightSideWidgets.rend();
for( ; it_end != it; ++it)
{
LLUICtrl* widget = *it;
if(!widget->getVisible())
{
continue;
}
LLRect widget_rect(widget->getRect());
widget_left = widget_right - widget_rect.getWidth();
widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight());
widget->setShape(widget_rect);
widget_right = widget_left - getWidgetSpacing();
}
mRightWidgetsWidth = getLocalRect().getWidth() - widget_left;
}