MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onMouseMove

Method onMouseMove

Engine/source/gui/controls/guiDecoyCtrl.cpp:129–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void GuiDecoyCtrl::onMouseMove(const GuiEvent &event)
130{
131 //if this control is a dead end, make sure the event stops here
132 if ( !mVisible || !mAwake )
133 return;
134
135 //pass the event to the parent
136 GuiControl *parent = getParent();
137 if ( parent )
138 parent->onMouseMove( event );
139
140 Point2I localPoint = parent->globalToLocalCoord(event.mousePoint);
141
142 //also pretty hacky. since guiCanvas, *NOT* GuiControl, distributes the calls for onMouseEnter
143 //and onMouseLeave, we simulate those calls here through a series of checks.
144 if(mIsDecoy == true)
145 {
146 mVisible = false;
147 GuiControl *tempControl = parent->findHitControl(localPoint);
148
149 //the decoy control has the responsibility of keeping track of the decoyed controls status
150 if(mMouseOverDecoy == false && mDecoyReference != NULL &&
151 !mDecoyReference->isDeleted() && !mDecoyReference->isRemoved())
152 {
153 tempControl->onMouseEnter(event);
154 mMouseOverDecoy = true;
155 }
156 else if(tempControl != mDecoyReference && mDecoyReference != NULL &&
157 !mDecoyReference->isDeleted() && !mDecoyReference->isRemoved())
158 {
159 mDecoyReference->onMouseLeave(event);
160 mMouseOverDecoy = false;
161 }
162
163 mDecoyReference = tempControl;
164 mVisible = true;
165 }
166}
167
168void GuiDecoyCtrl::onMouseDragged(const GuiEvent &event)
169{

Callers 1

autoScrollMethod · 0.45

Calls 6

globalToLocalCoordMethod · 0.80
isDeletedMethod · 0.80
isRemovedMethod · 0.80
findHitControlMethod · 0.45
onMouseEnterMethod · 0.45
onMouseLeaveMethod · 0.45

Tested by

no test coverage detected