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


C++ GuiControl::findHitControl方法代码示例

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


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

示例1: onMouseUp

void GuiDecoyCtrl::onMouseUp(const GuiEvent &event)
{
	mouseUnlock();
	setUpdate();  

	//this code is pretty hacky. right now there is no way that guiCanvas will allow sending more than
    //one signal to one gui control at a time. 
	if(mIsDecoy == true)
	{
		mVisible = false;

		GuiControl *parent = getParent();
		Point2I localPoint = parent->globalToLocalCoord(event.mousePoint);
		GuiControl *tempControl = parent->findHitControl(localPoint);

		//the decoy control has the responsibility of keeping track of the decoyed controls status
		if( mDecoyReference != NULL && tempControl == mDecoyReference)
			tempControl->onMouseUp(event);
		else if(mDecoyReference != NULL && tempControl != mDecoyReference)
		{
			//as explained earlier, this control was written in the mindset for buttons.
			//nothing bad should ever happen if not a button due to the checks in this function though.
			GuiButtonBaseCtrl *unCastCtrl = NULL;
			unCastCtrl = dynamic_cast<GuiButtonBaseCtrl *>( mDecoyReference );
			if(unCastCtrl != NULL)
				unCastCtrl->resetState();
		}
		mVisible = true;
	}
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:30,代码来源:guiDecoyCtrl.cpp

示例2: onMouseDown

void GuiDecoyCtrl::onMouseDown(const GuiEvent &event)
{
	if ( !mVisible || !mAwake )
      return;
	
	mouseLock();

	if(mIsDecoy == true)
	{
		mVisible = false;

		GuiControl *parent = getParent();
		Point2I localPoint = parent->globalToLocalCoord(event.mousePoint);

		GuiControl *tempControl = parent->findHitControl(localPoint);
		tempControl->onMouseDown(event);

		mVisible = true;
	}
	
   execConsoleCallback();
   setUpdate();
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:23,代码来源:guiDecoyCtrl.cpp

示例3: onMouseMove

void GuiDecoyCtrl::onMouseMove(const GuiEvent &event)
{
   //if this control is a dead end, make sure the event stops here
   if ( !mVisible || !mAwake )
      return;

   //pass the event to the parent
   GuiControl *parent = getParent();
   if ( parent )
      parent->onMouseMove( event );

   Point2I localPoint = parent->globalToLocalCoord(event.mousePoint);

   //also pretty hacky. since guiCanvas, *NOT* GuiControl, distributes the calls for onMouseEnter
   //and onMouseLeave, we simulate those calls here through a series of checks.
   if(mIsDecoy == true)
   {
	    mVisible = false;
		GuiControl *parent = getParent();
		GuiControl *tempControl = parent->findHitControl(localPoint);

		//the decoy control has the responsibility of keeping track of the decoyed controls status
		if(mMouseOverDecoy == false && mDecoyReference != NULL)
		{
			tempControl->onMouseEnter(event);
			mMouseOverDecoy = true;
		}
		else if(tempControl != mDecoyReference && mDecoyReference != NULL)
		{
			mDecoyReference->onMouseLeave(event);
			mMouseOverDecoy = false;
		}
		
		mDecoyReference = tempControl;
		mVisible = true;
   }
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:37,代码来源:guiDecoyCtrl.cpp


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