| 50 | } |
| 51 | |
| 52 | void 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 | // |
nothing calls this directly
no test coverage detected