public void Pressed(Point start) { this.pressedHandledBy = null; foreach (var el in this.elements.Where(e => e.Bounds.Contains(start))) { this.pressedHandledBy = el.Pressed(start.ClientTo(el.Location)); if (this.pressedHandledBy != null) { break; } } if (this.pressedHandledBy == null && this.PressedHandler != null) { this.pressedHandledBy = this.PressedHandler(start); } }
private void DoubleTap(Point p) { var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(p))) { if (el.DoubleTap(p.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.DoubleTapHandler != null) { this.DoubleTapHandler(p); } }
public void Pan(Point from, Point to, bool done) { var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(this.gestures.GestureStartPoint))) { if (el.Pan(from.ClientTo(el.Location), to.ClientTo(el.Location), done, this.gestures.GestureStartPoint.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.PanHandler != null) { this.PanHandler(from, to, done, this.gestures.GestureStartPoint); } }
public void Flick(Point from, Point to, int millisecs) { var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(this.gestures.GestureStartPoint))) { if (el.Flick(from.ClientTo(el.Location), to.ClientTo(el.Location), millisecs, this.gestures.GestureStartPoint.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.FlickHandler != null) { this.FlickHandler(from, to, millisecs, this.gestures.GestureStartPoint); } }
private void Tap(Point p) { this.Invoke( new Action(() => { if (this.pressedHandledBy != null && FleuxSettings.HapticFeedbackMode == FleuxSettings.HapticOptions.Tap) { FleuxApplication.Led.Vibrate(); } var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(p))) { if (el.Tap(p.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.TapHandler != null) { handled = this.TapHandler(p); } })); }
private void Hold(Point p) { var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(p))) { if (el.Hold(p.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.HoldHandler != null) { this.HoldHandler(p); } }
private void DoubleTap(Point p) { var handled = false; foreach (var el in this.elements.Where(e => e.Bounds.Contains(p)).ToArray()) { if (el.DoubleTap(p.ClientTo(el.Location))) { handled = true; break; } } if (!handled && this.DoubleTapHandler != null) { this.DoubleTapHandler(p); } }
public static Point ClientTo(this Point p1, Point p2) { return(p1.ClientTo(p2.X, p2.Y)); }