public bool InjectMouseUp( SIS.MouseEventArgs evt, SIS.MouseButtonID id )
{
// only process left button when stuff is visible
if ( !cursorLayer.IsVisible || id != SIS.MouseButtonID.Left )
return false;
Vector2 cursorPos = new Vector2( cursor.Left, cursor.Top );
if ( ExpandedMenu != null ) // only check top priority widget until it passes on
{
ExpandedMenu.OnCursorReleased( cursorPos );
return true;
}
if ( Dialog != null ) // only check top priority widget until it passes on
{
Dialog.OnCursorReleased( cursorPos );
if ( mOk != null )
mOk.OnCursorReleased( cursorPos );
else
{
mYes.OnCursorReleased( cursorPos );
// very important to check if second button still exists, because first button could've closed the popup
if ( mNo != null )
mNo.OnCursorReleased( cursorPos );
}
return true;
}
if ( !mTrayDrag )
return false; // this click did not originate in a tray, so don't process
Widget w;
for ( int i = 0; i < 10; 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.OnCursorReleased( cursorPos ); // send event to widget
}
}
mTrayDrag = false; // stop this drag
return true; // this click did originate in this tray, so don't pass it on
}