| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsPrerequisites.h" |
| 6 | #include "GUI/BsGUIDropDownMenu.h" |
| 7 | #include "Utility/BsModule.h" |
| 8 | |
| 9 | namespace bs |
| 10 | { |
| 11 | /** @addtogroup GUI-Internal |
| 12 | * @{ |
| 13 | */ |
| 14 | |
| 15 | /** Manages opening and closing of a drop down box. */ |
| 16 | class BS_EXPORT GUIDropDownBoxManager : public Module<GUIDropDownBoxManager> |
| 17 | { |
| 18 | public: |
| 19 | ~GUIDropDownBoxManager(); |
| 20 | |
| 21 | /** |
| 22 | * Opens a new drop down box at the specified location, look and elements. This will close any previously open drop |
| 23 | * down box. |
| 24 | * |
| 25 | * @param[in] desc Various parameters for initializing the drop down box. |
| 26 | * @param[in] type Specific type of drop down box to display. |
| 27 | * @param[in] onClosedCallback Callback triggered when drop down box is closed. |
| 28 | */ |
| 29 | GameObjectHandle<GUIDropDownMenu> openDropDownBox(const DROP_DOWN_BOX_DESC& desc, |
| 30 | GUIDropDownType type, std::function<void()> onClosedCallback); |
| 31 | |
| 32 | /** Closes the currently active drop down box (if any). */ |
| 33 | void closeDropDownBox(); |
| 34 | |
| 35 | private: |
| 36 | HSceneObject mDropDownSO; |
| 37 | GameObjectHandle<GUIDropDownMenu> mDropDownBox; |
| 38 | std::function<void()> mOnClosedCallback; |
| 39 | }; |
| 40 | |
| 41 | /** @} */ |
| 42 | } |