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

Method onMouseEvent

Engine/source/Verve/GUI/VEditorScrollControl.cpp:52–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void VEditorScrollControl::onMouseEvent( const char *pEventName, const GuiEvent &pEvent )
53{
54 const S32 offsetX = ( mHasVScrollBar ) ? mScrollBarThickness : 0;
55 const S32 offsetY = ( mHasHScrollBar ) ? mScrollBarThickness : 0;
56
57 const RectI contentRect( 2, 2, getWidth() - offsetX - 4 - 1, getHeight() - offsetY - 4 - ( mHasHScrollBar ) );
58 if ( !contentRect.pointInRect( pEvent.mousePoint ) )
59 {
60 // Return!
61 return;
62 }
63
64 // Argument Buffers.
65 char argBuffer[3][32];
66
67 // Format Event-Position Buffer.
68 dSprintf( argBuffer[0], 32, "%d %d", pEvent.mousePoint.x, pEvent.mousePoint.y );
69
70 // Format Event-Modifier Buffer.
71 dSprintf( argBuffer[1], 32, "%d", pEvent.modifier );
72
73 // Format Mouse-Click Count Buffer.
74 dSprintf( argBuffer[2], 32, "%d", pEvent.mouseClickCount );
75
76 // Call Scripts.
77 Con::executef( this, pEventName, argBuffer[0], argBuffer[1], argBuffer[2] );
78}
79
80//-----------------------------------------------------------------------------
81//

Callers

nothing calls this directly

Calls 5

getWidthFunction · 0.85
dSprintfFunction · 0.85
executefFunction · 0.85
pointInRectMethod · 0.80
getHeightFunction · 0.50

Tested by

no test coverage detected