public bool InjectMouseMove( SIS.MouseEventArgs evt )
{
if ( !cursorLayer.IsVisible )
return false; // don't process if cursor layer is invisible
cursor.SetPosition( evt.State.X.Absolute, evt.State.Y.Absolute );
Vector2 cursorPos = new Vector2( cursor.Left, cursor.Top );
if ( ExpandedMenu != null ) // only check top priority widget until it passes on
{
ExpandedMenu.OnCursorMoved( cursorPos );
return true;
}
if ( Dialog != null ) // only check top priority widget until it passes on
{
Dialog.OnCursorMoved( cursorPos );
if ( mOk != null )
mOk.OnCursorMoved( cursorPos );
else
{
mYes.OnCursorMoved( cursorPos );
mNo.OnCursorMoved( cursorPos );
}
return true;
}
Widget w;
for ( int i = 0; i < mTrays.Length; i++ )
{
if ( !mTrays[ i ].IsVisible )
continue;
for ( int j = 0; j < mWidgets[ i ].Count; j++ )
{
w = mWidgets[ i ][ j ];
if ( !w.OverlayElement.IsVisible )
continue;
w.OnCursorMoved( cursorPos ); // send event to widget
}
}
if ( mTrayDrag )
return true; // don't pass this event on if we're in the middle of a drag
return false;
}