Class CheckButtonBase
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
An abstract base class for check button widgets that display a checkbox image and content with toggle functionality.
public class CheckButtonBase : ButtonBase, IItemWithId, INotifyAttachedPropertyChanged, IContent
- Inheritance
-
CheckButtonBase
- Implements
- Derived
- Inherited Members
Constructors
CheckButtonBase()
Initializes a new instance of the CheckButtonBase class.
protected CheckButtonBase()
Properties
CheckContentSpacing
Gets or sets the spacing in pixels between the check box image and the content.
[StylePropertyPath("ImageTextSpacing")]
public int CheckContentSpacing { get; set; }
Property Value
CheckImage
Gets the image widget that displays the check box visual.
[Browsable(false)]
public Image CheckImage { get; }
Property Value
CheckPosition
Gets or sets the position of the check box image relative to the content.
public CheckPosition CheckPosition { get; set; }
Property Value
CheckedImage
Gets or sets the image displayed when the check button is checked.
[StylePropertyPath("ImageStyle/PressedImage")]
public IImage CheckedImage { get; set; }
Property Value
Content
Gets or sets the content widget displayed next to the check box.
[Browsable(false)]
public override Widget Content { get; set; }
Property Value
UncheckedImage
Gets or sets the image displayed when the check button is unchecked.
[StylePropertyPath("ImageStyle/Image")]
public IImage UncheckedImage { get; set; }
Property Value
Methods
ApplyStyle(WidgetStyle)
Applies the specified widget style to this check button.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies the check button properties from another check button.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe source check button to copy from.
InternalOnTouchDown()
Called when a touch point is pressed on the check button base, toggling its state.
protected override void InternalOnTouchDown()
InternalOnTouchUp()
Called when a touch point is released on the check button base.
protected override void InternalOnTouchUp()
OnKeyDown(Keys)
Handles keyboard input, toggling the check state when Space is pressed.
public override void OnKeyDown(Keys k)
Parameters
kKeysThe key being pressed.
OnPressedChanged()
Handles the pressed state change and updates the check image.
public override void OnPressedChanged()