protected override void OnPointerMoveInternal(IPointer cursor, Vector2f deltaMove) { base.OnPointerMoveInternal(cursor, deltaMove); // We check two position to see if enter/leave event should be fired. IWidget child1 = InputRouting.GetChildAtPosition(this, manager, cursor.CanvasPosition - deltaMove); IWidget child2 = InputRouting.GetChildAtPosition(this, manager, cursor.CanvasPosition); // If child was not changed. if (child1 == child2) { if (child1 != null) { child1.OnPointerMove(cursor, deltaMove); } } else { // TODO: maybe should adjust deltaMove to the move inside the child if (child1 != null) { // We first fire move event. child1.OnPointerMove(cursor, deltaMove); child1.OnPointerLeave(cursor); } if (child2 != null) { child2.OnPointerEnter(cursor); child2.OnPointerMove(cursor, deltaMove); } } }
protected override void OnPointerReleaseInternal(IPointer cursor, uint button) { base.OnPointerReleaseInternal(cursor, button); IWidget child = InputRouting.GetChildAtPosition(this, manager, cursor.CanvasPosition); if (child != null) { child.OnPointerRelease(cursor, button); } }
protected override void OnPointerPressInternal(IPointer cursor, uint button, InputEventModifier modifiers) { base.OnPointerPressInternal(cursor, button, modifiers); IWidget child = InputRouting.GetChildAtPosition(this, manager, cursor.CanvasPosition); if (child != null) { child.OnPointerPress(cursor, button, modifiers); } }