CommonTextButtonBehavior

abstract class CommonTextButtonBehavior<in T : Button>(textMetrics: TextMetrics, defaultFont: Font? = null, insets: Insets = None, focusManager: FocusManager? = null) : CommonButtonBehavior<T> (source)

A Behavior<Button> that handles most of the commonly expected behavior of buttons with text. This makes it a good base for more complex behaviors.

Parameters

textMetrics

used for measuring the button's text

defaultFont

used for buttons without a Font

insets

that determine padding around text.

focusManager

used to request focus

Inheritors

Constructors

Link copied to clipboard
constructor(textMetrics: TextMetrics, defaultFont: Font? = null, insets: Insets = None, focusManager: FocusManager? = null)

Properties

Link copied to clipboard
protected open val textChanged: (Button, String, String) -> Unit

Inherited properties

Link copied to clipboard
protected open val selectionChanged: (Button, Boolean, Boolean) -> Unit

Functions

Link copied to clipboard
fun font(button: Button): Font?
Link copied to clipboard
fun iconPosition(button: Button, text: String = button.text, icon: Icon<Button>, stringPosition: Point = textPosition(button, text, icon), bounds: Rectangle = button.bounds.atOrigin): Point
fun iconPosition(button: Button, text: String = button.text, icon: Icon<Button>, textSpacing: TextSpacing = default, stringPosition: Point = textPosition(button, text, icon, textSpacing = textSpacing), bounds: Rectangle = button.bounds.atOrigin): Point
Link copied to clipboard
open override fun install(view: T)
Link copied to clipboard
fun textPosition(button: Button, text: String = button.text, icon: Icon<Button>? = button.icon, bounds: Rectangle = button.bounds.atOrigin, textSpacing: TextSpacing = default): Point
Link copied to clipboard
open override fun uninstall(view: T)

Inherited functions

Link copied to clipboard
open fun childrenClipPath(view: T): View.ClipPath?
Link copied to clipboard
open fun clicked(event: PointerEvent)
Link copied to clipboard
open fun clipCanvasToBounds(view: T): Boolean
Link copied to clipboard
open fun contains(view: T, point: Point): Boolean
Link copied to clipboard
open override fun dragged(event: PointerEvent)
Link copied to clipboard
protected open fun enabledChanged(button: T)
Link copied to clipboard
open override fun entered(event: PointerEvent)
Link copied to clipboard
open override fun exited(event: PointerEvent)
Link copied to clipboard
protected fun icon(button: Button): Icon<Button>?
Link copied to clipboard
Link copied to clipboard
open fun moved(event: PointerEvent)
Link copied to clipboard
protected open fun pointerChanged(button: T)
Link copied to clipboard
open override fun pressed(event: KeyEvent)
open override fun pressed(event: PointerEvent)
Link copied to clipboard
open override fun released(event: KeyEvent)
open override fun released(event: PointerEvent)
Link copied to clipboard
open fun render(view: T, canvas: Canvas)
Link copied to clipboard
protected open fun stylesChanged(button: T)