Menu.cpp 427 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. new AsynchronCall([this]()
  15. {
  16. for (auto member : elements)
  17. zScreen->removeMember(dynamic_cast<Zeichnung*>(member->getThis()));
  18. });
  19. }