Button.cpp 672 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2024-05-16
  6. * Changed: 2024-05-30
  7. *
  8. * */
  9. #include "Button.hpp"
  10. using ls::std::event::EventListener;
  11. using ::std::string;
  12. using test::event::Button;
  13. Button::Button() : EventListener(), color("black")
  14. {}
  15. Button::~Button() noexcept = default;
  16. string Button::getColor() const
  17. {
  18. return this->color;
  19. }
  20. bool Button::isClicked() const
  21. {
  22. return this->clicked;
  23. }
  24. void Button::onChangeColorEvent()
  25. {
  26. this->color = this->parameter.get().front();
  27. }
  28. void Button::onClickEvent()
  29. {
  30. this->clicked = !this->clicked;
  31. }