Menu.cpp 463 B

12345678910111213141516171819202122
  1. #include "Menu.h"
  2. #include <AsynchronCall.h>
  3. Menu::Menu(Bildschirm* zScreen)
  4. : ReferenceCounter(),
  5. zScreen(zScreen)
  6. {}
  7. void Menu::show()
  8. {
  9. for (auto member : elements)
  10. zScreen->addMember(dynamic_cast<Zeichnung*>(member->getThis()));
  11. }
  12. void Menu::hide()
  13. {
  14. zScreen->postAction([this]() {
  15. for (auto member : elements)
  16. zScreen->removeMember(dynamic_cast<Zeichnung*>(member->getThis()));
  17. });
  18. }