Base Framework
Public Types | Public Member Functions | List of all members
Button Class Reference

Button widget. More...

#include <base/ui/Button.h>

Inherits Widget.

Public Types

enum  { PREFERRED_HORIZONTAL_MARGIN = 16, PREFERRED_VERTICAL_MARGIN = 8 }
 
enum  State { GRAYED, CHECKED, UNCHECKED }
 
enum  { PREFERRED_HORIZONTAL_MARGIN = 16, PREFERRED_VERTICAL_MARGIN = 8 }
 
- Public Types inherited from GraphicsContext
enum  SystemColor {
  WINDOW_BACKGROUND, WINDOW_FRAME, WINDOW_TEXT, MENU,
  MENU_TEXT, BUTTON_TEXT, DISABLED_TEXT, HIGHLIGHTED_TEXT
}
 
enum  PenStyle {
  NONE, SOLID, DASH, DOT,
  DASH_DOT, DASH_DOT_DOT
}
 
enum  FontFlags { ITALIC = 1, UNDERLINE = 2, STRIKE_OUT = 4 }
 
enum  FontWeight {
  THIN, LIGHT, NORMAL, BOLD,
  HEAVY
}
 
enum  GraphicsFlag { FILLED = 1 }
 
- Public Types inherited from WindowImpl
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 

Public Member Functions

 Button (Window &owner)
 
const StringgetText () const
 
Dimension getPreferredSize ()
 
void setText (const String &text)
 
void onMouseScope (bool scope) noexcept
 
void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
void onDisplay () noexcept
 
virtual void onSelection () noexcept
 
 ~Button () noexcept
 
 Button (Window &owner)
 
Color getBackground () const noexcept
 
void setBackground (Color background)
 
Color getTextColor () const noexcept
 
void setTextColor (Color textColor)
 
const StringgetText () const
 
void setText (const String &text)
 
void onResize (const Dimension &dimension) noexcept
 
void onMouseScope (bool scope) noexcept
 
void onMouseMove (const Position &position, unsigned int state) noexcept
 
void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
void onDisplay () noexcept
 
 Button (Window &owner)
 
const StringgetText () const
 
Dimension getPreferredSize ()
 
void setText (const String &text)
 
void onMouseScope (bool scope) noexcept
 
void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
void onDisplay () noexcept
 
virtual void onSelection () noexcept
 
 ~Button () noexcept
 
- Public Member Functions inherited from Widget
 Widget (Window &owner)
 
 ~Widget () noexcept
 
- Public Member Functions inherited from GraphicsContext
 GraphicsContext ()
 
 GraphicsContext (const Position &position, const Dimension &dimension, unsigned int flags)
 
const PengetPen () const noexcept
 
void setPen (Pen pen)
 
const BrushgetBrush () const noexcept
 
void setBrush (Brush brush)
 
const FontgetFont () const noexcept
 
void setFont (Font font)
 
void setBackgroundMode (bool transparent)
 
void setBackgroundColor (Color color)
 
void setTextColor (Color color)
 
void setTextAlignment (unsigned int alignment)
 
void clear ()
 
void clear (const Position &position, const Dimension &dimension)
 
void setPixel (const Position &position, Color color, unsigned int flags=0)
 
Color getPixel (const Position &position)
 
void setPixels (const Array< Position > &positions, Color color, unsigned int flags=0)
 
void moveTo (const Position &position)
 
void lineTo (const Position &position, unsigned int flags=0)
 
void line (const Position &upperLeft, const Position &lowerRight, unsigned int flags=0)
 
void arc (const Position &position, const Dimension &dimension, int start, int stop, unsigned int flags=0)
 
void rectangle (const Position &upperLeft, const Position &b, unsigned int flags=0)
 
void rectangle (const Position &position, const Dimension &dimension, unsigned int flags=0)
 
void rectangle (const Position &upperLeft, const Position &lowerRight, Brush brush, unsigned int flags=0)
 
void rectangle (const Position &position, const Dimension &dimension, Brush brush, unsigned int flags=0)
 
void ellipse (const Position &upperLeft, const Position &lowerRight, unsigned int flags=0)
 
void ellipse (const Position &position, const Dimension &dimension, unsigned int flags=0)
 
void circle (const Position &position, unsigned int dimension, unsigned int flags=0)
 
void pie (const Position &upperLeft, const Position &lowerRight, const Position &radialA, const Position &radialB, unsigned int flags)
 
unsigned int getWidthOf (char ch) const
 
Dimension getDimensionOf (const String &text) const
 
void text (const Position &position, const Dimension &dimension, const String &text, unsigned int flags=0)
 
void putBitmap (const Position &position, const Dimension &dimension, const Bitmap &bitmap)
 
Bitmap getBitmap (const Position &position, const Dimension &dimension)
 
 ~GraphicsContext () noexcept
 
- Public Member Functions inherited from WindowImpl
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getLocalBindingOffset (Binding binding) const noexcept
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from WindowImpl
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
- Protected Member Functions inherited from WindowImpl
void construct () noexcept
 
void construct () noexcept
 
void construct () noexcept
 
- Protected Attributes inherited from WindowImpl
String title
 
String iconTitle
 
Position position
 
Dimension dimension
 
unsigned int flags = 0
 
Dimension minimumSize
 
Dimension maximumSize
 
void * screenHandle = nullptr
 
void * graphicsContextHandle = nullptr
 
- Protected Attributes inherited from Drawable
void * drawableHandle = nullptr
 
- Static Protected Attributes inherited from WindowImpl
static void * displayHandle
 

Detailed Description

Button widget.

Push button widget.

Version
1.0

Member Enumeration Documentation

◆ State

The button state.

Enumerator
GRAYED 

Grayed state.

CHECKED 

Checked state.

UNCHECKED 

Unchecked state.

Constructor & Destructor Documentation

◆ Button() [1/3]

Button::Button ( Window owner)

Initializes the button widget.

◆ ~Button() [1/2]

Button::~Button ( )
inlinenoexcept

Destroys the button.

◆ Button() [2/3]

Button::Button ( Window owner)

Initializes the button widget.

◆ Button() [3/3]

Button::Button ( Window owner)

Initializes the button widget.

◆ ~Button() [2/2]

Button::~Button ( )
inlinenoexcept

Destroys the button.

Member Function Documentation

◆ getBackground()

Color Button::getBackground ( ) const
inlinenoexcept

Returns the background color.

◆ getPreferredSize() [1/2]

Dimension Button::getPreferredSize ( )

Returns the preferred size of the button.

◆ getPreferredSize() [2/2]

Dimension Button::getPreferredSize ( )

Returns the preferred size of the button.

◆ getText() [1/3]

const String& Button::getText ( ) const
inline

Returns the button text.

◆ getText() [2/3]

const String& Button::getText ( ) const
inline

Returns the button text.

◆ getText() [3/3]

const String& Button::getText ( ) const
inline

Returns the button text.

◆ getTextColor()

Color Button::getTextColor ( ) const
inlinenoexcept

Returns the text color.

◆ onDisplay() [1/3]

void Button::onDisplay ( )
virtualnoexcept

Invoked when the button must be updated.

Reimplemented from WindowImpl.

◆ onDisplay() [2/3]

void Button::onDisplay ( )
virtualnoexcept

Invoked when the button must be updated.

Reimplemented from WindowImpl.

◆ onDisplay() [3/3]

void Button::onDisplay ( )
virtualnoexcept

Invoked when the button must be updated.

Reimplemented from WindowImpl.

◆ onKey() [1/3]

void Button::onKey ( unsigned int  key,
unsigned int  flags,
unsigned int  modifiers 
)
virtualnoexcept

Invoked on keyboard events.

Reimplemented from WindowImpl.

◆ onKey() [2/3]

void Button::onKey ( unsigned int  key,
unsigned int  flags,
unsigned int  modifiers 
)
virtualnoexcept

Invoked on keyboard events.

Reimplemented from WindowImpl.

◆ onKey() [3/3]

void Button::onKey ( unsigned int  key,
unsigned int  flags,
unsigned int  modifiers 
)
virtualnoexcept

Invoked on keyboard events.

Reimplemented from WindowImpl.

◆ onMouseButton() [1/3]

void Button::onMouseButton ( const Position position,
Mouse::Button  button,
Mouse::Event  event,
unsigned int  state 
)
noexcept

Invoked when a mouse button is pressed or released over the button.

◆ onMouseButton() [2/3]

void Button::onMouseButton ( const Position position,
Mouse::Button  button,
Mouse::Event  event,
unsigned int  state 
)
noexcept

Invoked when a mouse button is pressed or released over the button.

◆ onMouseButton() [3/3]

void Button::onMouseButton ( const Position position,
Mouse::Button  button,
Mouse::Event  event,
unsigned int  state 
)
noexcept

Invoked when a mouse button is pressed or released over the button.

◆ onMouseMove()

void Button::onMouseMove ( const Position position,
unsigned int  buttons 
)
virtualnoexcept

Invoked when the mouse is moved.

Parameters
positionThe position of the mouse pointer.
buttonsThe current state of the mouse buttons.

Reimplemented from WindowImpl.

◆ onMouseScope() [1/3]

void Button::onMouseScope ( bool  scope)
virtualnoexcept

Invoked when the mouse cursor enters and exists the scope of the button.

Reimplemented from WindowImpl.

◆ onMouseScope() [2/3]

void Button::onMouseScope ( bool  scope)
virtualnoexcept

Invoked when the mouse cursor enters and exists the scope of the button.

Reimplemented from WindowImpl.

◆ onMouseScope() [3/3]

void Button::onMouseScope ( bool  scope)
virtualnoexcept

Invoked when the mouse cursor enters and exists the scope of the button.

Reimplemented from WindowImpl.

◆ onResize()

void Button::onResize ( const Dimension dimension)
virtualnoexcept

Invoked when the button is resized.

Reimplemented from WindowImpl.

◆ onSelection() [1/2]

virtual void Button::onSelection ( )
virtualnoexcept

Invoked when the button is selected.

◆ onSelection() [2/2]

virtual void Button::onSelection ( )
virtualnoexcept

Invoked when the button is selected.

◆ setBackground()

void Button::setBackground ( Color  background)

Sets the background color.

◆ setText() [1/3]

void Button::setText ( const String text)

Sets the button text.

◆ setText() [2/3]

void Button::setText ( const String text)

Sets the button text.

◆ setText() [3/3]

void Button::setText ( const String text)

Sets the button text.

◆ setTextColor()

void Button::setTextColor ( Color  textColor)

Sets the color of the button text.