本文整理汇总了C++中GuiControl::onMouseEnter方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiControl::onMouseEnter方法的具体用法?C++ GuiControl::onMouseEnter怎么用?C++ GuiControl::onMouseEnter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiControl
的用法示例。
在下文中一共展示了GuiControl::onMouseEnter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}