guiFileSelectMenu.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Minetest
  3. Copyright (C) 2013 sapier
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 3.0 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #ifndef GUIFILESELECTMENU_H_
  17. #define GUIFILESELECTMENU_H_
  18. #include <string>
  19. #include "modalMenu.h"
  20. #include "IGUIFileOpenDialog.h"
  21. #include "guiFormSpecMenu.h" //required because of TextDest only !!!
  22. class GUIFileSelectMenu : public GUIModalMenu
  23. {
  24. public:
  25. GUIFileSelectMenu(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id,
  26. IMenuManager *menumgr, const std::string &title,
  27. const std::string &formid);
  28. ~GUIFileSelectMenu();
  29. void removeChildren();
  30. /*
  31. Remove and re-add (or reposition) stuff
  32. */
  33. void regenerateGui(v2u32 screensize);
  34. void drawMenu();
  35. bool OnEvent(const SEvent &event);
  36. void setTextDest(TextDest *dest) { m_text_dst = dest; }
  37. private:
  38. void acceptInput();
  39. std::wstring m_title;
  40. bool m_accepted;
  41. gui::IGUIFileOpenDialog *m_fileOpenDialog;
  42. TextDest *m_text_dst;
  43. std::string m_formname;
  44. };
  45. #endif /* GUIFILESELECTMENU_H_ */