Skip to content

MenuButton

JaykeBird edited this page Feb 21, 2023 · 9 revisions

Back to home | Back to Reference | View raw text

MenuButton class

Description

A flat-styled button that displays a menu when it is clicked.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.MenuButton[[MenuButton]]
  SolidShineUi.FlatButton[[FlatButton]]
  end
SolidShineUi.FlatButton --> SolidShineUi.MenuButton
Loading

Members

Properties

Public properties

Type Name Methods
bool KeepMenuArrowOnRight
Get or set if the arrow should be kept to the right side of the button, even if the content of the button is left or center aligned.
get, set
ContextMenu Menu
Get or set the menu that appears when the button is clicked.
get, set
PlacementMode MenuPlacement
Get or set the placement mode for the MenuButton's menu.
get, set
Rect MenuPlacementRectangle
Get or set the placement rectangle for the MenuButton's menu. This sets the area relative to the button that the menu is positioned.
get, set
bool ShowMenuArrow
Get or set if an arrow should be shown to the right of the button content to indicate the button as a menu button.
get, set
bool StaysOpen
Get or set if the menu should close automatically. Remember to set the StaysOpenOnClick property for child menu items as well.
get, set

Methods

Public methods

Returns Name
void ApplyColorScheme(...)
Apply a color scheme to this control, and set some other optional appearance settings. The color scheme can quickly apply a whole visual style to the control.

Details

Summary

A flat-styled button that displays a menu when it is clicked.

Inheritance

Constructors

MenuButton

public MenuButton()
Summary

Create a new MenuButton.

Methods

ApplyColorScheme [1/2]

public void ApplyColorScheme(ColorScheme cs, bool transparentBack, bool useAccentColors)
Arguments
Type Name Description
ColorScheme cs The color scheme to apply
bool transparentBack Set if the button should have no background when not focused or highlighted. This can also be achieved with the TransparentBack property.
bool useAccentColors Set if accent colors should be used for this button, rather than the main color scheme colors.
This can also be achieved with the UseAccentColors property.
Summary

Apply a color scheme to this control, and set some other optional appearance settings. The color scheme can quickly apply a whole visual style to the control.

ApplyColorScheme [2/2]

public void ApplyColorScheme(HighContrastOption hco, bool transparentBack)
Arguments
Type Name Description
HighContrastOption hco The high-contrast color scheme to apply.
bool transparentBack Set if the button should have no background when not focused or highlighted. This can also be achieved with the TransparentBack property.
Summary

Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

Properties

Menu

public ContextMenu Menu { get; set; }
Summary

Get or set the menu that appears when the button is clicked.

MenuPlacement

public PlacementMode MenuPlacement { get; set; }
Summary

Get or set the placement mode for the MenuButton's menu.

MenuPlacementRectangle

public Rect MenuPlacementRectangle { get; set; }
Summary

Get or set the placement rectangle for the MenuButton's menu. This sets the area relative to the button that the menu is positioned.

StaysOpen

public bool StaysOpen { get; set; }
Summary

Get or set if the menu should close automatically. Remember to set the StaysOpenOnClick property for child menu items as well.

ShowMenuArrow

public bool ShowMenuArrow { get; set; }
Summary

Get or set if an arrow should be shown to the right of the button content to indicate the button as a menu button.

KeepMenuArrowOnRight

public bool KeepMenuArrowOnRight { get; set; }
Summary

Get or set if the arrow should be kept to the right side of the button, even if the content of the button is left or center aligned.

Generated with ModularDoc

Clone this wiki locally