| 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/BsGUILayout.h" |
| 7 | |
| 8 | namespace bs |
| 9 | { |
| 10 | /** @addtogroup GUI |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** Represents a vertical layout that will layout out its child elements top to bottom. */ |
| 15 | class BS_EXPORT GUILayoutY final : public GUILayout |
| 16 | { |
| 17 | public: |
| 18 | GUILayoutY() = default; |
| 19 | GUILayoutY(const GUIDimensions& dimensions); |
| 20 | ~GUILayoutY() = default; |
| 21 | |
| 22 | /** Creates a new vertical layout. */ |
| 23 | static GUILayoutY* create(); |
| 24 | |
| 25 | /** |
| 26 | * Creates a new vertical layout. |
| 27 | * |
| 28 | * @param[in] options Options that allow you to control how is the element positioned and sized. |
| 29 | */ |
| 30 | static GUILayoutY* create(const GUIOptions& options); |
| 31 | |
| 32 | public: // ***** INTERNAL ****** |
| 33 | /** @name Internal |
| 34 | * @{ |
| 35 | */ |
| 36 | |
| 37 | /** Calculate optimal sizes of all child layout elements. */ |
| 38 | void _updateOptimalLayoutSizes() override; |
| 39 | |
| 40 | /** @copydoc GUIElementBase::_calculateLayoutSizeRange */ |
| 41 | LayoutSizeRange _calculateLayoutSizeRange() const override; |
| 42 | |
| 43 | /** @copydoc GUILayout::_getElementAreas */ |
| 44 | void _getElementAreas(const Rect2I& layoutArea, Rect2I* elementAreas, UINT32 numElements, |
| 45 | const Vector<LayoutSizeRange>& sizeRanges, const LayoutSizeRange& mySizeRange) const override; |
| 46 | |
| 47 | /** @} */ |
| 48 | |
| 49 | protected: |
| 50 | /** @copydoc GUIElementBase::_updateLayoutInternal */ |
| 51 | void _updateLayoutInternal(const GUILayoutData& data) override; |
| 52 | }; |
| 53 | |
| 54 | /** @} */ |
| 55 | } |