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); }
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); }
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; } }
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; }