ScrollGesture

GestureWidgetSince v2.12
[Handler(ScrollGesture.IHandler)] public class ScrollGesture : Gesture
Gesture for multidimensional scrolling, such as with a mouse wheel or two finger trackpad scroll input.

Fields

DefaultWheelScrollAmount

#
public const float DefaultWheelScrollAmount = 48
Gets the default logical distance represented by one wheel notch.

Properties

Control

public Control Control { get; }
Gets the control that this gesture is attached to, or null if not attached to a control.
inherited fromGesture

ControlObject

public object ControlObject { get; }
Gets the instance of the platform-specific object
inherited fromWidget
Remarks: This can sometimes be useful to get the platform-specific object. Some handlers may not have any backing object for its functionality, so this may be null. It is more preferred to use the Widget.Handler and cast that to the platform-specific handler class which can give you additional methods and helpers to do common tasks. For example, the Application object's handler for OS X has a AddFullScreenMenuItem property to specify if you want full screen support in your app.

Delta

#
public SizeF Delta { get; }
Gets the current scroll delta for the gesture activation, in logical coordinates.

Enabled

public bool Enabled { get; set; }
Gets or sets a value indicating whether this gesture can be recognized.
inherited fromGesture

Handler

public object Handler { get; }
Gets the platform-specific handler for this widget
inherited fromWidget

IsDirectionInverted

#
public bool IsDirectionInverted { get; }
Gets a value indicating that the Delta is inverted from the direction of the physical device.
Remarks:

This is true when the user has turned on natural (or reverse) scrolling for the device that generated the input, in which case the platform has already flipped the Delta so that the content follows the user's fingers. Use this when you need to move something with the device instead of with the content, such as panning a canvas with a two finger scroll.

Only platforms that expose the setting per event report this (currently macOS via NSEvent.isDirectionInvertedFromDevice). Elsewhere this is always false, as the platform gives no way to tell an inverted delta from a regular one.

IsDisposed

public bool IsDisposed { get; }
Gets or sets a value indicating whether this Widget has been disposed.
inherited fromWidget
Remarks: When the widget is disposed, it can no longer be used.
true if this instance has been disposed; otherwise, false.

NativeHandle

public nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
inherited fromWidget

Platform

public Platform Platform { get; }
Gets the platform that was used to create the Widget.Handler for this widget
inherited fromWidget
Remarks: This gets set to the current Platform.Instance during the construction of the object

Properties

public PropertyStore Properties { get; }
Gets the dictionary of properties for this widget
inherited fromWidget

Style

public string Style { get; set; }
Gets or sets the style of this widget
inherited fromWidget
Remarks: Styles allow you to attach custom platform-specific logic to a widget. In your platform-specific assembly, use Add{H} to add the style logic with the same id.
// in your UI
var control = new Button { Style = "mystyle" };

// in your platform assembly
using Eto.Mac.Forms.Controls;

Styles.AddHandler<ButtonHandler>("mystyle", handler => {
	// this is where you can use handler.Control to set properties, handle events, etc.
	handler.Control.BezelStyle = NSBezelStyle.SmallSquare;
});

Velocity

#
public PointF Velocity { get; }
Gets the current scroll velocity for the gesture activation, in logical coordinates per second.

WheelScrollAmount

#
public float WheelScrollAmount { get; set; }
Gets or sets the logical distance represented by one wheel notch.
Remarks: This is used to normalize wheel-style input to logical coordinates. Precise scrolling input that already reports logical deltas, such as macOS trackpad scrolling, is not scaled.

Methods

AllowSimultaneousWith

public void AllowSimultaneousWith(Gesture gesture)
Allows this gesture and the specified gesture to recognize simultaneously.
inherited fromGesture
Remarks: This adds the pairing to both gestures.
gesture (Gesture)Gesture to allow.

AllowSimultaneousWith

public void AllowSimultaneousWith(Type gestureType)
Allows this gesture to recognize simultaneously with gestures of the specified type.
inherited fromGesture

AllowSimultaneousWith<TGesture>

public void AllowSimultaneousWith<TGesture>()
Allows this gesture to recognize simultaneously with gestures of the specified type.
inherited fromGesture

AllowsSimultaneousRecognition

public bool AllowsSimultaneousRecognition(Gesture otherGesture)
Determines whether this gesture allows simultaneous recognition with the specified gesture.
inherited fromGesture
otherGesture (Gesture)Other gesture being recognized.
True if this gesture allows simultaneous recognition with otherGesture.

CanRecognizeSimultaneouslyWith

public bool CanRecognizeSimultaneouslyWith(Gesture otherGesture)
Determines whether this gesture and another gesture mutually allow simultaneous recognition.
inherited fromGesture
otherGesture (Gesture)Other gesture being recognized.
True if both gestures allow simultaneous recognition with each other.

DisallowSimultaneousWith

public void DisallowSimultaneousWith(Gesture gesture)
Removes a previously allowed simultaneous gesture pairing.
inherited fromGesture
Remarks: This removes the pairing from both gestures.
gesture (Gesture)Gesture pairing to remove.

DisallowSimultaneousWith

public void DisallowSimultaneousWith(Type gestureType)
Removes a previously allowed simultaneous gesture type.
inherited fromGesture

DisallowSimultaneousWith<TGesture>

public void DisallowSimultaneousWith<TGesture>()
Removes a previously allowed simultaneous gesture type.
inherited fromGesture

Dispose

protected virtual void Dispose(bool disposing)
Handles the disposal of this widget
inherited fromWidget
disposing (bool)True if the caller called Widget.Dispose() manually, false if being called from a finalizer

GetCallback

protected override object GetCallback()
Gets an instance of an object used to perform callbacks to the widget from handler implementations
inherited fromGesture
Remarks: The callback should implement the parent class' Widget.ICallback interface so that there only needs to be a single callback for the entire hierarchy. This should return a static instance to avoid having overhead for each instance of your control.
The callback instance to use for this widget

Initialize

protected void Initialize()
Initializes the widget handler
inherited fromWidget
Remarks: This is typically called from the constructor after all of the logic is completed to construct the object. If your handler interface has the AutoInitializeAttribute set to false, then you are responsible for calling this method in your constructor after calling the creation method on your custom handler.

OnStyleChanged

protected virtual void OnStyleChanged(EventArgs e)
Handles when the Widget.Style is changed.
inherited fromWidget

ToString

public override string ToString()
Gets a string that represents the current object with its ID if specified.
inherited fromWidget
A string value indicating the type and ID (if specified) of this widget.
Object.ToString

Events

CanRecognizeSimultaneously

public event EventHandler<GestureRecognitionEventArgs> CanRecognizeSimultaneously
Occurs when determining whether this gesture can recognize simultaneously with another gesture.
inherited fromGesture
Remarks: Simultaneous recognition requires both gestures to allow the pairing.