Table of Contents

Class PlatformModuleButton

Namespace
ATAS.Indicators.Modules
Assembly
ATAS.Indicators.dll

A button a PlatformModule shows in the header of its panel, next to the standard buttons of the platform. Create it, set its properties and add it to Buttons; the same code works in %ATAS and %ATAS X. Changing a property of a button that is in the list updates the header.

Not in ATAS 8.0.15 yet: available from the next version.

[Obfuscation(Feature = "renaming", ApplyToMembers = true, Exclude = true)]
public sealed class PlatformModuleButton
Inheritance
object
PlatformModuleButton
Extension Methods

Remarks

A click is delivered to PlatformModule.OnButtonClick (which calls Click by default) like every other callback of the module: never concurrently with another one, and with the same error and time limit rules. Change the buttons only from the callbacks of the module.

Constructors

PlatformModuleButton(string)

Initializes a button; set its caption, icon and click handler through the properties.

public PlatformModuleButton(string id)

Parameters

id string

The id of the button, unique among the buttons of the module.

PlatformModuleButton(string, string?, Action?)

Initializes a button with a caption and a click handler.

public PlatformModuleButton(string id, string? text, Action? click = null)

Parameters

id string

The id of the button, unique among the buttons of the module.

text string

The caption of the button.

click Action

Called when the user clicks the button.

Properties

Click

Called when the user clicks the button (by the default PlatformModule.OnButtonClick). An exception thrown here stops the module like an exception of any other callback.

public Action? Click { get; set; }

Property Value

Action

Icon

The icon as path geometry data in a 16×16 box, in the syntax WPF and Avalonia share (for example "M4,2 L14,8 L4,14 Z"): the platform fills it with the color of the header texts. PlatformModuleIcons has ready-made ones. null: no icon. Data the platform cannot read is ignored (the button shows its text or its id).

public string? Icon { get; set; }

Property Value

string

Id

The id of the button, unique among the buttons of the module (for example "pause").

public string Id { get; }

Property Value

string

IsCheckable

True for a toggle: every click of the user flips IsChecked before the click is delivered to the module.

public bool IsCheckable { get; set; }

Property Value

bool

IsChecked

The state of a toggle (IsCheckable): a checked button is highlighted.

public bool IsChecked { get; set; }

Property Value

bool

IsEnabled

False shows the button greyed out; it is not clicked.

public bool IsEnabled { get; set; }

Property Value

bool

IsVisible

False hides the button without removing it from the list.

public bool IsVisible { get; set; }

Property Value

bool

Text

The caption shown on the button, or null for a button with an icon only.

public string? Text { get; set; }

Property Value

string

ToolTip

The hint shown when the mouse is over the button.

public string? ToolTip { get; set; }

Property Value

string

Methods

ToString()

Returns the id of the button.

public override string ToString()

Returns

string

The id.