#include <togglebutton.h>
Inheritance diagram for wftk::ToggleButton:

Public Member Functions | |
| ToggleButton (const std::string &text, const Font &font=Font::registry.find("button_font")) | |
| Create a ToggleButton with the given text as a label. | |
| 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 () |
| as opposed to the Button class, this does nothing | |
| virtual void | lostFocus () |
| as opposed to the Button class, this does nothing | |
This class implements a different behavior to Button. The button stays pressed until it is clicked again. The autorepeat flag is ignored.
| wftk::ToggleButton::ToggleButton | ( | const std::string & | text, | |
| const Font & | font = Font::registry.find("button_font") | |||
| ) | [explicit] |
Create a ToggleButton with the given text as a label.
| text | text for the button label, defaults to empty string | |
| font | font to use for the text, defaults to "button_font" |
| bool wftk::ToggleButton::buttonEvent | ( | Mouse::Button | button, | |
| bool | pressed_val, | |||
| const Point & | pos | |||
| ) | [virtual] |
triggered when a button event happens
| button | which mouse button is producing the event | |
| pressed_val | is the button pressed or released | |
| pos | position of the cursor |
Reimplemented from wftk::Button.
| bool wftk::ToggleButton::keyEvent | ( | const SDL_keysym & | sym, | |
| bool | pressed_val | |||
| ) | [virtual] |
triggered when a keyboard event happens
| sym | SDL_keysym type, i.e. the key that triggered the event | |
| pressed_val | is the key pressed or released |
Reimplemented from wftk::Button.
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.