本文整理汇总了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;
}
}
示例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();
}
示例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;
}
}