diff options
| author | crupest <crupest@outlook.com> | 2018-11-19 23:10:45 +0800 | 
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2018-11-19 23:10:45 +0800 | 
| commit | 5291b587708b7f1b9be9187aa4df99ea2cfe0538 (patch) | |
| tree | 7d5d91ba4a0d979ceefea05bbe99efc47a9bf6a3 /CruUI-Generate/cru_ui.hpp | |
| parent | 3edc249f48b4d7e692c782c1ca4809e07fa0726f (diff) | |
| download | cru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.tar.gz cru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.tar.bz2 cru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.zip | |
Add FrameLayout.
Diffstat (limited to 'CruUI-Generate/cru_ui.hpp')
| -rw-r--r-- | CruUI-Generate/cru_ui.hpp | 52 | 
1 files changed, 52 insertions, 0 deletions
| diff --git a/CruUI-Generate/cru_ui.hpp b/CruUI-Generate/cru_ui.hpp index ddfd8d9e..93360e3a 100644 --- a/CruUI-Generate/cru_ui.hpp +++ b/CruUI-Generate/cru_ui.hpp @@ -701,6 +701,21 @@ namespace cru::ui              return top + bottom;          } +        void SetLeftRight(const float value) +        { +            left = right = value; +        } + +        void SetTopBottom(const float value) +        { +            top = bottom = value; +        } + +        void SetAll(const float value) +        { +            left = top = right = bottom = value; +        } +          float Validate() const          {              return left >= 0.0 && top >= 0.0 && right >= 0.0 && bottom >= 0.0; @@ -2775,6 +2790,43 @@ namespace cru::ui::controls  //-------end of file: src\ui\controls\popup_menu.hpp  //--------------------------------------------------------  //-------------------------------------------------------- +//-------begin of file: src\ui\controls\frame_layout.hpp +//-------------------------------------------------------- + +#include <initializer_list> + + +namespace cru::ui::controls +{ +    class FrameLayout : public Control +    { +    public: +        static constexpr auto control_type = L"FrameLayout"; + +        static FrameLayout* Create(const std::initializer_list<Control*>& children = std::initializer_list<Control*>{}) +        { +            const auto layout = new FrameLayout(); +            for (auto child : children) +                layout->AddChild(child); +            return layout; +        } + +    protected: +        FrameLayout(); +    public: +        FrameLayout(const FrameLayout& other) = delete; +        FrameLayout(FrameLayout&& other) = delete; +        FrameLayout& operator=(const FrameLayout& other) = delete; +        FrameLayout& operator=(FrameLayout&& other) = delete; +        ~FrameLayout() override; + +        StringView GetControlType() const override final; +    }; +} +//-------------------------------------------------------- +//-------end of file: src\ui\controls\frame_layout.hpp +//-------------------------------------------------------- +//--------------------------------------------------------  //-------begin of file: src\graph\graph.hpp  //-------------------------------------------------------- | 
