Table of Contents

Class MenuItemNode

Namespace
Fantas.UI
Assembly
Fantas.dll

Menu Item Node

public class MenuItemNode : ControlNode
Inheritance
MenuItemNode
Inherited Members
Extension Methods

Constructors

MenuItemNode(string, Texture, SizeF, Font, bool)

Create Menu Item

public MenuItemNode(string text, Texture iconTexture, SizeF size, Font menuFont, bool hasSubItems = false)

Parameters

text string
iconTexture Texture
size SizeF
menuFont Font
hasSubItems bool

Properties

DisabledColor

Color when item is disabled

public Color DisabledColor { get; set; }

Property Value

Color

HoverColor

Color when item is hovered

public Color HoverColor { get; set; }

Property Value

Color

HoverSelectedColor

Color when item is hovered and selected

public Color HoverSelectedColor { get; set; }

Property Value

Color

IsSelected

Whether this item is currently selected by its parent menu

public bool IsSelected { get; set; }

Property Value

bool

NormalColor

Color when item is in normal state

public Color NormalColor { get; set; }

Property Value

Color

PressedColor

Color when item is pressed

public Color PressedColor { get; set; }

Property Value

Color

SelectedColor

Color when item is selected

public Color SelectedColor { get; set; }

Property Value

Color

Text

Menu item text

public string Text { get; set; }

Property Value

string

Methods

OnClick(MouseEventArgs)

Node override to fire Activated on left-click

public override void OnClick(MouseEventArgs args)

Parameters

args MouseEventArgs

OnStateChanged()

Updates text color based on control state (normal, hovered, pressed, selected). Called automatically by base class when State property changes.

protected override void OnStateChanged()

OnTouchUpInside(TouchEventArgs)

Node override to fire Activated on touch-up

public override void OnTouchUpInside(TouchEventArgs args)

Parameters

args TouchEventArgs

Events

Activated

Fired when the item is activated (clicked or tapped)

public event EventHandler Activated

Event Type

EventHandler