Table of Contents

Class PresetBar

Namespace
PluginUI
Assembly
PluginUI.dll

Preset manager bar: previous / next buttons, the preset name (click to choose from a menu grouped by bank, "*" when modified) and an actions menu (Save, Save As…, Delete). Works with any IPresetProvider.

public class PresetBar : Control
Inheritance
PresetBar
Inherited Members

Constructors

PresetBar()

Creates a preset bar.

public PresetBar()

PresetBar(IPresetProvider)

Creates a preset bar over a provider.

public PresetBar(IPresetProvider provider)

Parameters

provider IPresetProvider

Properties

CurrentName

Display name of the current preset.

public string CurrentName { get; }

Property Value

string

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

ExtraActions

Extra entries appended to the actions menu.

public IList<MenuItem> ExtraActions { get; }

Property Value

IList<MenuItem>

Placeholder

Text shown when no preset is loaded (null = localized PresetPlaceholder, "Init").

public string? Placeholder { get; set; }

Property Value

string

Provider

Preset source.

[Browsable(false)]
public IPresetProvider? Provider { get; set; }

Property Value

IPresetProvider

ShowActions

Shows the actions (Save, Save As…, Delete) menu button.

public bool ShowActions { get; set; }

Property Value

bool

ValueText

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

public override string? ValueText { get; }

Property Value

string

Wrap

Wraps around at the ends of the list with previous / next.

public bool Wrap { get; set; }

Property Value

bool

Methods

BeginSaveAs()

Starts in-place editing of a new preset name; Enter saves.

public void BeginSaveAs()

Next()

Loads the next preset.

public void Next()

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

OnMouseLeave()

The mouse left the element.

protected override void OnMouseLeave()

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

OpenActionsMenu()

Opens the actions menu.

public void OpenActionsMenu()

OpenPresetMenu()

Opens the preset list menu.

public void OpenPresetMenu()

Previous()

Loads the previous preset.

public void Previous()

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