The button of Lumen (lumen_button), behind the button element. A text panel that takes
the mouse, lightens when hovered, is drawn with the active_background of its style when
set_active is on, is dimmed and ignores clicks when set_enabled is off, and can show a
FontAwesome icon in front of its text with set_icon. Fires the on_press and
on_right_press props when a button is released over it. Derives from lumen_text.
Summary
Methods
active_background of its style.Methods
Returns the background to draw right now: the active, hovered or plain one of the style.
Returns
- Color, or nil for none
Returns the color of the text right now.
Returns
- Color
Returns the size of the icon, which is the height of a line of the font.
Returns
- Number
Returns the width the icon and the space after it take up.
Returns
- Number 0 without an icon or without the FontAwesome package
Takes the mouse and shows the hand cursor.
Checks whether the button is marked as selected.
Returns
- Boolean
Checks whether the button is enabled.
Returns
- Boolean
Forgets a press when the cursor leaves the panel.
Remembers that a button went down on the panel.
Parameters
- code Number mouse button
Fires the press handler of the button that went down on the panel.
Parameters
- code Number mouse button
Draws the background, the icon and the text.
Parameters
- w Number panel width
- h Number panel height
Marks the button as selected, which draws it with the active_background of its style.
Parameters
- active Boolean
Enables or disables the button. A disabled button ignores clicks and draws its text in
the disabled_color of its style, or darkened.
Parameters
- enabled Boolean
Sets the FontAwesome icon drawn in front of the text.
Parameters
- icon String icon ID such as 'fa-times', or nil for none
Fades the hover highlight in and out.