Responses

References
public abstract class Responses
Class for handling UI responses.

Constructors

Responses

#
protected Responses(
CoordinateSystem
system = CoordinateSystem.Content
)

Properties

CoordinatesContext

#
Gets the mouse coordinate system this responsive expects to operate in.
public CoordinateSystem CoordinatesContext { get; }

HadEffect

#
Indicates whether this responsive has actually performed an effect during its current interaction. Returning false tells the dispatcher that a Response.Release from this responsive should be downgraded to Response.Ignored, so other dispatch paths (e.g. context menu population) still get a chance to handle the same event. Default is true: regular responsives consume the event whenever they release focus. Transient interactions like Pan / Zoom override this to false while idle so a no-drag RMB click can still pop a context menu.
public virtual bool HadEffect { get; }

HasFocus

#
Gets or sets whether this responsive currently has focus. This is set by the hosting control; there is no need to set it yourself.
public bool HasFocus { get; set; }

RegionBoundary

#
Gets or sets the boundary of this region. When the mouse is outside of this boundary, it is assumed to not be relevant to this responsive. Within the boundary additional filtering may be in effect.
public RectangleF RegionBoundary { get; set; }

RegionFilter

#
Gets or sets the additional coincidence filter for within the region. If unset, the RegionBoundary is assumed to represent this responsive object exactly. The delegate should return false, if the given point is not considered to be coincident with this responsive.
public Func<PointF, bool> RegionFilter { get; set; }

Methods

InvokeKeyRelay

#
Walk a key-event hook's invocation list and return the first non-Response.Ignored result. See InvokeMouseRelay(Func<ResponseMouseArgs, Response>, ResponseMouseArgs) for rationale.
protected static Response InvokeKeyRelay(
Func<KeyEventArgs, Response>
hook,
KeyEventArgs
e
)

InvokeMouseRelay

#
Walk a hook event's invocation list and return the first non-Response.Ignored result. Returns Response.Ignored if no handler is subscribed or none consumed the event. Used to give attribute-subclass subscribers a chance to handle an event after the Responder's own logic has declined it.
protected static Response InvokeMouseRelay()

InvokeRotationRelay

#
Walk a rotation-gesture hook's invocation list and return the first non-Response.Ignored result. See InvokeMouseRelay(Func<ResponseMouseArgs, Response>, ResponseMouseArgs) for rationale.
protected static Response InvokeRotationRelay()

InvokeTextInputRelay

#
Walk a text-input hook's invocation list and return the first non-Response.Ignored result. See InvokeMouseRelay(Func<ResponseMouseArgs, Response>, ResponseMouseArgs) for rationale.
protected static Response InvokeTextInputRelay(
Func<TextInputEventArgs, Response>
hook,
TextInputEventArgs
e
)

IsCoincident

#
Test for point-region coincidence. Both coordinate-system locations are supplied; this method internally picks the one matching this responder's CoordinatesContext, so callers don't have to know which system each responder operates in.
public bool IsCoincident(
PointF
controlPoint,
Cursor location in raw control-space pixels.
PointF
contentPoint
Cursor location in content-space (projected).
)

KeyDown

#
Called when this responsive has focus and there's a key down event. May also be called if the cursor is over this responsive. Depends on the host.
public virtual Response KeyDown(
KeyEventArgs
e
)

KeyUp

#
Called when this responsive has focus and there's a key up event. May also be called if the cursor is over this responsive. Depends on the host.
public virtual Response KeyUp(
KeyEventArgs
e
)

MouseDoubleClick

#
Called when the mouse goes down and up twice over this responsive without moving too much in between.
public virtual Response MouseDoubleClick()

MouseDown

#
Called when one of the mouse buttons goes down over this responsive region.
public virtual Response MouseDown()

MouseDrag

#
Called when the mouse moves while one or more buttons are pressed. For this method to be invoked the preceding MouseDown(ResponseMouseArgs) call has to return Response.Capture. Only the focused responsive receives this call.
public virtual Response MouseDrag()

MouseLeave

#
Called when the hosting control detects the mouse leaves this responsive region.
public virtual void MouseLeave()

MouseOver

#
Called when the mouse moves over this responsive without any pressed buttons. Fires on every cursor motion while the cursor is over the responsive (not a delayed "dwell" event — use FlexControl.MouseDwell for that). Only the responsive currently under the cursor receives this call. Returns void: hover dispatch cannot transition a responsive into focus (Capture only comes from MouseDown), so a Response would be vestigial. If your hover handling changes visible state, call OnRedrawRequired() or update through an InvalidateDisplay path.
public virtual void MouseOver()

MouseSingleClick

#
Called when the mouse goes down and up over this responsive without moving too much in between.
public virtual Response MouseSingleClick()

MouseUp

#
Called when one of the mouse buttons goes up, after a MouseDown(ResponseMouseArgs) call to this same responsive.
public virtual Response MouseUp()

MouseWheel

#
Called when the mouse wheel spins while the cursor is over this responsive.
public virtual Response MouseWheel()

OnRedrawRequired

#
Raise the RedrawRequired event.
public void OnRedrawRequired()

Rotation

#
Called when a rotation gesture is recognized over this responsive. The rotation delta is in clockwise degrees.
public virtual Response Rotation()

TextInput

#
Called when this responsive has focus and there's a text input event.
public virtual Response TextInput(
TextInputEventArgs
e
)

Events

GotFocus

#
Raised whenever focus is set to this responsive.
public event EventHandler GotFocus

KeyDownHook

#
Fires when KeyDown(KeyEventArgs)'s own logic would return Response.Ignored.
public event Func<KeyEventArgs, Response> KeyDownHook

KeyUpHook

#
Fires when KeyUp(KeyEventArgs)'s own logic would return Response.Ignored.
public event Func<KeyEventArgs, Response> KeyUpHook

LostFocus

#
Raised whenver focus is removed from this responsive.
public event EventHandler LostFocus

MouseDoubleClickHook

#
Fires when MouseDoubleClick(ResponseMouseArgs)'s own logic would return Response.Ignored.
public event Func<ResponseMouseArgs, Response> MouseDoubleClickHook

MouseDownHook

#
Fires when MouseDown(ResponseMouseArgs)'s own logic would return Response.Ignored. Subscribers handle the event in subscription order; the first to return a non-Ignored result wins.
public event Func<ResponseMouseArgs, Response> MouseDownHook

MouseDragHook

#
Fires when MouseDrag(ResponseMouseArgs)'s own logic would return Response.Ignored.
public event Func<ResponseMouseArgs, Response> MouseDragHook

MouseLeaveHook

#
Fires after MouseLeave()'s own logic completes. Allows attribute subclasses to plug additional leave behaviour into a base class's Responder.
public event Action MouseLeaveHook

MouseOverHook

#
Fires after MouseOver(ResponseMouseArgs)'s own logic completes. Allows subclasses to plug additional hover behaviour into a base class's Responder.
public event Action<ResponseMouseArgs> MouseOverHook

MouseSingleClickHook

#
Fires when MouseSingleClick(ResponseMouseArgs)'s own logic would return Response.Ignored.
public event Func<ResponseMouseArgs, Response> MouseSingleClickHook

MouseUpHook

#
Fires when MouseUp(ResponseMouseArgs)'s own logic would return Response.Ignored.
public event Func<ResponseMouseArgs, Response> MouseUpHook

MouseWheelHook

#
Fires when MouseWheel(ResponseMouseArgs)'s own logic would return Response.Ignored.
public event Func<ResponseMouseArgs, Response> MouseWheelHook

RedrawRequired

#
Raised whenever this responsive wants its host to redraw. Hosting controls are expected to subscribe and call ScheduleRedraw/Invalidate.
public event EventHandler RedrawRequired

RotationHook

#
Fires when Rotation(ResponseRotationArgs)'s own logic would return Response.Ignored.
public event Func<ResponseRotationArgs, Response> RotationHook

TextInputHook

#
Fires when TextInput(TextInputEventArgs)'s own logic would return Response.Ignored.
public event Func<TextInputEventArgs, Response> TextInputHook