BsGUIDropDownBoxManager.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsGUIDropDownBox.h"
  4. #include "BsModule.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Managed opening and closing of a drop down box.
  9. */
  10. class BS_EXPORT GUIDropDownBoxManager : public Module<GUIDropDownBoxManager>
  11. {
  12. public:
  13. ~GUIDropDownBoxManager();
  14. /**
  15. * @brief Opens a new drop down box at the specified location, look and elements. This will close
  16. * any previously open drop down box.
  17. *
  18. * @param target Viewport on which to open the drop down box.
  19. * @param placement Determines how is the drop down box positioned in the visible area.
  20. * @param dropDownData Data to use for initializing menu items of the drop down box.
  21. * @param skin Skin to use for drop down box GUI elements.
  22. * @param type Specific type of drop down box to display.
  23. * @param onClosedCallback Callback triggered when drop down box is closed.
  24. */
  25. GameObjectHandle<GUIDropDownBox> openDropDownBox(Viewport* target, const GUIDropDownAreaPlacement& placement,
  26. const GUIDropDownData& dropDownData, const GUISkin& skin, GUIDropDownType type, std::function<void()> onClosedCallback);
  27. /**
  28. * @brief Closes the currently active drop down box (if any).
  29. */
  30. void closeDropDownBox();
  31. private:
  32. HSceneObject mDropDownSO;
  33. GameObjectHandle<GUIDropDownBox> mDropDownBox;
  34. std::function<void()> mOnClosedCallback;
  35. };
  36. }