BsGUIDropDownBoxManager.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPrerequisites.h"
  5. #include "BsGUIDropDownMenu.h"
  6. #include "BsModule.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup GUI-Internal
  10. * @{
  11. */
  12. /** Manages opening and closing of a drop down box. */
  13. class BS_EXPORT GUIDropDownBoxManager : public Module<GUIDropDownBoxManager>
  14. {
  15. public:
  16. ~GUIDropDownBoxManager();
  17. /**
  18. * Opens a new drop down box at the specified location, look and elements. This will close any previously open drop
  19. * down box.
  20. *
  21. * @param[in] desc Various parameters for initializing the drop down box.
  22. * @param[in] type Specific type of drop down box to display.
  23. * @param[in] onClosedCallback Callback triggered when drop down box is closed.
  24. */
  25. GameObjectHandle<GUIDropDownMenu> openDropDownBox(const DROP_DOWN_BOX_DESC& desc,
  26. GUIDropDownType type, std::function<void()> onClosedCallback);
  27. /** Closes the currently active drop down box (if any). */
  28. void closeDropDownBox();
  29. private:
  30. HSceneObject mDropDownSO;
  31. GameObjectHandle<GUIDropDownMenu> mDropDownBox;
  32. std::function<void()> mOnClosedCallback;
  33. };
  34. /** @} */
  35. }