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

Method onRightMouseDown

Engine/source/Verve/GUI/VTimeLineControl.cpp:198–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void VTimeLineControl::onRightMouseDown( const GuiEvent &pEvent )
199{
200 Parent::onRightMouseDown( pEvent );
201
202 if ( !mIsController || !mController || mController->isPlaying() )
203 {
204 return;
205 }
206
207 // Calculate Time.
208 const Point2I hitPoint = globalToLocalCoord( pEvent.mousePoint );
209 const S32 time = mClamp( toTime( hitPoint.x ), 0, mController->getDuration() );
210
211 // Set First Responder.
212 setFirstResponder();
213
214 if ( mSelection.Active )
215 {
216 const S32 minTime = getMin( mSelection.StartTime, mSelection.EndTime );
217 const S32 maxTime = getMax( mSelection.StartTime, mSelection.EndTime );
218 if ( time >= minTime && time <= maxTime )
219 {
220 // Callback.
221 onMouseEvent( "onSelectionRightClick", pEvent );
222
223 // Don't Update Time.
224 return;
225 }
226 else
227 {
228 if ( mSelection.Active )
229 {
230 // Selection Invalid.
231 mSelection.Active = false;
232
233 // Callback.
234 Con::executef( this, "onSelectionUpdate" );
235 }
236 }
237 }
238
239 // Reset.
240 mController->reset( time );
241}
242
243void VTimeLineControl::onMouseEvent( const char *pEventName, const GuiEvent &pEvent )
244{

Callers

nothing calls this directly

Calls 6

mClampFunction · 0.85
getMaxFunction · 0.85
executefFunction · 0.85
isPlayingMethod · 0.45
getDurationMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected