Button.cpp 721 B

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