Struct BaseButton

Base class for different kinds of buttons.

struct BaseButton ;

BaseButton is the abstract base class for buttons, so it shouldn't be used directly (it doesn't display anything). Other types of buttons inherit from it.

Properties

NameTypeDescription
actionMode[get, set] BaseButton.ActionModeDetermines when the button is considered clicked, one of the actionmode constants.
buttonMask[get, set] longBinary mask to choose which mouse buttons this button will respond to. To allow both left-click and right-click, use BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT.
disabled[get, set] boolIf true, the button is in disabled state and can't be clicked or toggled.
enabledFocusMode[get, set] Control.FocusModeFocus access mode to use when switching between enabled/disabled (see Control.focusMode and disabled).
group[get, set] ButtonGroupButtonGroup associated to the button.
keepPressedOutside[get, set] boolIf true, the button stays pressed when moving the cursor outside the button while pressing it.
pressed[get, set] boolIf true, the button's state is pressed. Means the button is pressed down or toggled (if toggleMode is active).
shortcut[get, set] ShortCutShortCut associated to the button.
shortcutInTooltip[get, set] boolIf true, the button will add information about its shortcut in the tooltip.
toggleMode[get, set] boolIf true, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked.

Methods

NameDescription
_guiInput
_pressed Called when the button is pressed.
_toggled Called when the button is toggled (only if toggleMode is active).
_unhandledInput
getActionMode
getButtonGroup
getButtonMask
getDrawMode Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding draw() or connecting to "draw" signal. The visual state of the button is defined by the drawmode enum.
getEnabledFocusMode
getShortcut
isDisabled
isHovered Returns true if the mouse has entered the button and has not left it yet.
isKeepPressedOutside
isPressed
isShortcutInTooltipEnabled
isToggleMode
setActionMode
setButtonGroup
setButtonMask
setDisabled
setEnabledFocusMode
setKeepPressedOutside
setPressed
setShortcut
setShortcutInTooltip
setToggleMode

Enums

NameDescription
ActionMode
Constants
DrawMode