6#include "fifechan/widgets/togglebutton.hpp"
12#include "fifechan/platform.hpp"
18 ToggleButton::ToggleButton()
23 ToggleButton::ToggleButton(std::string
const & caption, std::string
const & group,
bool selected) :
31 ToggleButton::~ToggleButton()
44 if (selected && !
mGroup.empty()) {
51 if (iter->second->isSelected()) {
52 iter->second->setSelected(
false);
75 if (iter->second ==
this) {
83 mGroupMap.insert(std::pair<std::string, ToggleButton*>(group,
this));
101 Key
const key = keyEvent.
getKey();
103 if ((key.getValue() == fcn::Key::KEY_RETURN || key.getValue() == fcn::Key::SPACE) &&
mKeyPressed) {
116 }
else if (mouseEvent.
getButton() == MouseEvent::Button::Left) {
Key const & getKey() const
Gets the key of the event.
Represents a mouse event.
MouseEvent::Button getButton() const
Gets the button of the mouse event.
Used replacement tokens by configure_file():