| 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/BsGUIElement.h" |
| 7 | |
| 8 | namespace bs |
| 9 | { |
| 10 | /** @addtogroup GUI-Internal |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** Base for GUI elements that combine multiple GUI elements into one more complex element. */ |
| 15 | class BS_EXPORT GUIElementContainer : public GUIElement |
| 16 | { |
| 17 | public: |
| 18 | /** @copydoc GUIElement::setFocus */ |
| 19 | void setFocus(bool enabled, bool clear = false) override; |
| 20 | |
| 21 | protected: |
| 22 | GUIElementContainer(const GUIDimensions& dimensions, const String& style = StringUtil::BLANK, |
| 23 | GUIElementOptions options = GUIElementOptions(0)); |
| 24 | virtual ~GUIElementContainer() = default; |
| 25 | |
| 26 | /** @copydoc GUIElement::_getNumRenderElements */ |
| 27 | UINT32 _getNumRenderElements() const override; |
| 28 | |
| 29 | /** @copydoc GUIElement::_getMaterial */ |
| 30 | const SpriteMaterialInfo& _getMaterial(UINT32 renderElementIdx, SpriteMaterial** material) const override; |
| 31 | |
| 32 | /** @copydoc GUIElement::_getMeshInfo() */ |
| 33 | void _getMeshInfo(UINT32 renderElementIdx, UINT32& numVertices, UINT32& numIndices, GUIMeshType& type) const override; |
| 34 | |
| 35 | /** @copydoc GUIElement::_fillBuffer */ |
| 36 | void _fillBuffer(UINT8* vertices, UINT32* indices, UINT32 vertexOffset, UINT32 indexOffset, |
| 37 | UINT32 maxNumVerts, UINT32 maxNumIndices, UINT32 renderElementIdx) const override; |
| 38 | |
| 39 | /** @copydoc GUIElement::_getOptimalSize */ |
| 40 | Vector2I _getOptimalSize() const override; |
| 41 | |
| 42 | /** @copydoc GUIElement::_commandEvent */ |
| 43 | bool _commandEvent(const GUICommandEvent& ev) override; |
| 44 | |
| 45 | GUIElement* mFocusElement = nullptr; |
| 46 | }; |
| 47 | |
| 48 | /** @} */ |
| 49 | } |