Skip to main content

Class Button

Represents a clickable display button in the user interface.

Assembly: MicroLayout.dll
View Source
public class Button : ClickableControl, IThemedControl, IClickableControl, IControl

Inheritance: System.Object -> Meadow.Foundation.Graphics.MicroLayout.Control -> Meadow.Foundation.Graphics.MicroLayout.ThemedControl -> Meadow.Foundation.Graphics.MicroLayout.ClickableControl

Implements:
Meadow.Foundation.Graphics.MicroLayout.IThemedControl, Meadow.Foundation.Graphics.MicroLayout.IClickableControl, Meadow.Foundation.Graphics.MicroLayout.IControl

Properties

ForeColor

Gets or sets the foreground color of the button when not pressed.

View Source
public Color ForeColor { get; set; }

PressedColor

Gets or sets the foreground color of the button when pressed.

View Source
public Color PressedColor { get; set; }

HighlightColor

Gets or sets the highlight color of the button.

View Source
public Color HighlightColor { get; set; }

ShadowColor

Gets or sets the shadow color of the button.

View Source
public Color ShadowColor { get; set; }

TextColor

Gets or sets the text color of the button.

View Source
public Color TextColor { get; set; }

Text

Gets or sets the text to be displayed on the button.

View Source
public string Text { get; set; }

Image

Gets or sets the image to be displayed on the button.

View Source
public Image? Image { get; set; }

Font

Gets or sets the font used for displaying the text on the button.

View Source
public IFont? Font { get; set; }

ScaleFactor

ScaleFactor used to calculate drawn text size

View Source
public ScaleFactor ScaleFactor { get; set; }

Methods

ApplyTheme(DisplayTheme)

Applies the specified display theme to the display button.

View Source
public override void ApplyTheme(DisplayTheme theme)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroLayout.DisplayThemethemeThe display theme to apply.

OnDraw(MicroGraphics)

Draws the display button on the specified Meadow.Foundation.Graphics.MicroGraphics surface.

View Source
protected override void OnDraw(MicroGraphics graphics)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroGraphicsgraphicsThe Meadow.Foundation.Graphics.MicroGraphics surface to draw the button on.

Implements