Table of Contents

Class XYPad

Namespace
PluginUI
Assembly
PluginUI.dll

Two-dimensional pad editing X and Y at once (filter cutoff/resonance, vector mixing, panning). Click jumps the handle, drag moves it (Shift = fine, relative), double-click resets both axes. Each axis can be bound to a parameter; both gestures run together.

public class XYPad : Control
Inheritance
XYPad
Inherited Members

Constructors

XYPad()

Creates a pad centered at (0.5, 0.5).

public XYPad()

Properties

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

DefaultX

Default X (reset).

public double DefaultX { get; set; }

Property Value

double

DefaultY

Default Y (reset).

public double DefaultY { get; set; }

Property Value

double

FineFactor

Sensitivity multiplier while Shift is held.

public float FineFactor { get; set; }

Property Value

float

GridDivisions

Grid divisions per axis (0 = no grid).

public int GridDivisions { get; set; }

Property Value

int

HandleRadius

Handle radius in DIPs.

public float HandleRadius { get; set; }

Property Value

float

ShowCrosshair

Draws crosshair lines through the handle.

public bool ShowCrosshair { get; set; }

Property Value

bool

ValueText

Text drawn in the value area (null = no value area).

public override string? ValueText { get; }

Property Value

string

X

Horizontal value (normalized, 0 = left).

public double X { get; set; }

Property Value

double

XFormatter

Formatter of the X axis value.

[Browsable(false)]
public Func<double, string>? XFormatter { get; set; }

Property Value

Func<double, string>

XParameter

Parameter bound to X.

public IParameter? XParameter { get; set; }

Property Value

IParameter

Y

Vertical value (normalized, 0 = bottom).

public double Y { get; set; }

Property Value

double

YFormatter

Formatter of the Y axis value.

[Browsable(false)]
public Func<double, string>? YFormatter { get; set; }

Property Value

Func<double, string>

YParameter

Parameter bound to Y.

public IParameter? YParameter { get; set; }

Property Value

IParameter

Methods

HandlePosition(Rect)

Handle center for the current values inside a widget rectangle.

public Point HandlePosition(Rect widget)

Parameters

widget Rect

Returns

Point

OnAttached()

Called when the element joins a host (subscribe to external events here).

protected override void OnAttached()

OnCaptureLost()

The mouse capture was lost without a button release.

protected override void OnCaptureLost()

OnDetached()

Called when the element leaves its host (unsubscribe here).

protected override void OnDetached()

OnKeyDown(KeyEventArgs)

Key pressed while focused (bubbles to parents).

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

OnMouseDown(MouseEventArgs)

Mouse button pressed over the element (or captured).

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseMove(MouseEventArgs)

Mouse moved over the element (or captured).

protected override void OnMouseMove(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Mouse button released.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle

Events

PositionChanged

Raised when X or Y changes.

public event Action<XYPad, double, double>? PositionChanged

Event Type

Action<XYPad, double, double>