当前位置: 首页>>代码示例>>C++>>正文


C++ LLView::calcScreenRect方法代码示例

本文整理汇总了C++中LLView::calcScreenRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLView::calcScreenRect方法的具体用法?C++ LLView::calcScreenRect怎么用?C++ LLView::calcScreenRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLView的用法示例。


在下文中一共展示了LLView::calcScreenRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateHoveredState

void LLToast::updateHoveredState()
{
	S32 x, y;
	LLUI::getMousePositionScreen(&x, &y);

	LLRect panel_rc = mWrapperPanel->calcScreenRect();
	LLRect button_rc;
	if(mHideBtn)
	{
		button_rc = mHideBtn->calcScreenRect();
	}

	if (!panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y))
	{
		// mouse is not over this toast
		mIsHovered = false;
	}
	else
	{
		bool is_overlapped_by_other_floater = false;

		const child_list_t* child_list = gFloaterView->getChildList();

		// find this toast in gFloaterView child list to check whether any floater
		// with higher Z-order is visible under the mouse pointer overlapping this toast
		child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
		if (r_iter != child_list->rend())
		{
			// skip this toast and proceed to views above in Z-order
			for (++r_iter; r_iter != child_list->rend(); ++r_iter)
			{
				LLView* view = *r_iter;
				is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
				if (is_overlapped_by_other_floater)
				{
					break;
				}
			}
		}

		mIsHovered = !is_overlapped_by_other_floater;
	}

	LLToastLifeTimer* timer = getTimer();
	
	if (timer)
	{	
		// Started timer means the mouse had left the toast previously.
		// If toast is hovered in the current frame we should handle
		// a mouse enter event.
		if(timer->getStarted() && mIsHovered)
		{
			mOnToastHoverSignal(this, MOUSE_ENTER);
			
			updateTransparency();
			
			//toasts fading is management by Screen Channel
			
			sendChildToFront(mHideBtn);
			if(mHideBtn && mHideBtn->getEnabled())
			{
				mHideBtn->setVisible(TRUE);
			}
			
			mToastMouseEnterSignal(this, getValue());
		}
		// Stopped timer means the mouse had entered the toast previously.
		// If the toast is not hovered in the current frame we should handle
		// a mouse leave event.
		else if(!timer->getStarted() && !mIsHovered)
		{
			mOnToastHoverSignal(this, MOUSE_LEAVE);
			
			updateTransparency();
			
			//toasts fading is management by Screen Channel
			
			if(mHideBtn && mHideBtn->getEnabled())
			{
				if( mHideBtnPressed )
				{
					mHideBtnPressed = false;
					return;
				}
				mHideBtn->setVisible(FALSE);
			}
			
			mToastMouseLeaveSignal(this, getValue());
		}
	}
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:91,代码来源:lltoast.cpp


注:本文中的LLView::calcScreenRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。