#include <button.h>
Inheritance diagram for wftk::Button:
Public Member Functions | |
Button (const std::string &text, const Font &font=Font::registry.find("button_font")) | |
Explicit Constructor. | |
void | press () |
press the button by calling a function | |
void | release () |
release the button by calling a function | |
void | repeat () |
repeat the click on the button | |
void | toggle () |
toggle the button, i.e. | |
bool | isPressed () const |
check if the button is pressed right now | |
void | setRepeat (unsigned repeat=100) |
set the repeat interval | |
void | setRepeat (bool repeat) |
turn repeating on or off
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
virtual bool | buttonEvent (Mouse::Button button, bool pressed_val, const Point &pos) |
triggered when a button event happens | |
virtual bool | keyEvent (const SDL_keysym &sym, bool pressed_val) |
triggered when a keyboard event happens | |
virtual void | lostMouse () |
called if the user moves the mouse off the button after pressing it | |
virtual void | lostFocus () |
called if the window loses focus | |
Public Attributes | |
ButtonSignal | pressed |
SigC signal triggered when button is pressed, also plays the named Sample "press". | |
ButtonSignal | released |
SigC signal triggered when button is released, also plays the named Sample "release". | |
ButtonSignal | clicked |
SigC signal triggered when button is clicked. |
|
Explicit Constructor. This creates a Button type object. It's not really inteded to be used as standalone object, but it's a parent for other buttons, eg. the PushButton class.
|
|
triggered when a button event happens
Reimplemented from wftk::Widget. Reimplemented in wftk::ToggleButton. |
|
check if the button is pressed right now
|
|
triggered when a keyboard event happens
Reimplemented from wftk::Widget. Reimplemented in wftk::ToggleButton. |
|
called if the window loses focus It unsets the pressed state without triggering a released signal Reimplemented from wftk::Widget. Reimplemented in wftk::ToggleButton. |
|
called if the user moves the mouse off the button after pressing it it unsets the pressed state of the button and triggers a released signal Reimplemented from wftk::ScreenArea. Reimplemented in wftk::ToggleButton. |
|
press the button by calling a function This is used if the programmer for some reason needs to press a button without the user doing so |
|
release the button by calling a function This is used to release a key without user input (e.g. for unsetting buttons in a radio-button group) |
|
repeat the click on the button This is called if the the click needs to be repeated. |
|
turn repeating on or off This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
set the repeat interval
|
|
toggle the button, i.e. set it to pressed if it isn't, and vice versa |
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.