UIModalOps.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <UI/AEWidget.h>
  6. using namespace Atomic;
  7. using namespace tb;
  8. #include <TurboBadger/tb_widgets_listener.h>
  9. namespace tb
  10. {
  11. class TBDimmer;
  12. class TBWindow;
  13. class TBEditField;
  14. }
  15. namespace AtomicEditor
  16. {
  17. class UIModalOpWindow : public AEWidget
  18. {
  19. OBJECT(UIModalOpWindow);
  20. public:
  21. UIModalOpWindow(Context* context);
  22. virtual ~UIModalOpWindow();
  23. bool OnEvent(const TBWidgetEvent &ev);
  24. TBWindow* GetWindow() { return window_; }
  25. protected:
  26. void Center();
  27. TBWindow* window_;
  28. };
  29. class UIModalOps: public AEWidget, private TBWidgetListener
  30. {
  31. OBJECT(UIModalOps)
  32. void ShowCreateComponent(const String& resourcePath);
  33. void ShowCreateScript(const String& resourcePath);
  34. void ShowCreateModule(const String& resourcePath);
  35. void ShowCreate2DLevel(const String& resourcePath);
  36. void ShowResourceDelete(const String& resourcePath);
  37. void ShowNewFolder(const String& resourcePath);
  38. void ShowBuildSettings();
  39. void ShowBuild();
  40. void ShowNewProject();
  41. void ShowCreateProject(const String& templateFolder, const String& imagePath = String::EMPTY);
  42. void ShowActivation();
  43. void ShowActivationSuccess();
  44. void ShowManageLicense();
  45. void ShowAbout();
  46. void ShowInfoModule3D();
  47. void ShowPlatformsInfo();
  48. void ShowEulaAgreement();
  49. void ShowPlayer();
  50. // Whether there is a modal window currently showing
  51. bool ModalActive() { return opWindow_.NotNull(); }
  52. void ShowProgramOutput(Object* subprocess);
  53. void PrintToProgramOutput(const String& text);
  54. /// Allows you to change the program key being output to the output window
  55. void SetProgramOutputSubprocess(Object* subprocess);
  56. void Hide();
  57. public:
  58. UIModalOps(Context* context);
  59. virtual ~UIModalOps();
  60. bool OnEvent(const TBWidgetEvent &ev);
  61. const String& GetResourcePath() { return resourcePath_; }
  62. private:
  63. void Show();
  64. void HandleEditorShutdown(StringHash eventType, VariantMap& eventData);
  65. // TBWidgetListener
  66. void OnWidgetDelete(TBWidget *widget);
  67. bool OnWidgetDying(TBWidget *widget);
  68. TBDimmer* dimmer_;
  69. String resourcePath_;
  70. bool isHiding_;
  71. SharedPtr<UIModalOpWindow> opWindow_;
  72. };
  73. }