neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
border_layout.hpp
Go to the documentation of this file.
1// border_layout.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
28
29namespace neogfx
30{
31 class border_layout : public layout
32 {
34 public:
35 struct not_implemented : std::logic_error { not_implemented() : std::logic_error("neogfx::border_layout::not_implemented") {} };
36 public:
41 public:
42 const i_layout& part(layout_position aPosition) const;
44 const i_layout& top() const;
46 const i_layout& left() const;
48 const i_layout& center() const;
50 const i_layout& right() const;
52 const i_layout& bottom() const;
54 public:
55 i_spacer& add_spacer() override;
56 i_spacer& add_spacer_at(layout_item_index aPosition) override;
57 public:
58 void invalidate(bool aDeferLayout = true) override;
59 public:
60 void layout_items(const point& aPosition, const size& aSize) override;
61 void fix_weightings(bool aRecalculate = true) override;
62 public:
63 size minimum_size(optional_size const& aAvailableSpace = optional_size{}) const override;
64 size maximum_size(optional_size const& aAvailableSpace = optional_size{}) const override;
65 public:
66 void set_autoscale(neogfx::autoscale aAutoscale, bool aUpdateLayout = true) override;
67 private:
68 void init();
69 private:
70 vertical_layout iRows;
72 horizontal_layout iMiddle;
73 vertical_layout iLeft;
74 stack_layout iCenter;
75 vertical_layout iRight;
76 horizontal_layout iBottom;
77 };
78}
void fix_weightings(bool aRecalculate=true) override
const i_layout & top() const
i_spacer & add_spacer_at(layout_item_index aPosition) override
const i_layout & left() const
void invalidate(bool aDeferLayout=true) override
border_layout(neogfx::alignment aAlignment=neogfx::alignment::VCenter)
i_layout & part(layout_position aPosition)
const i_layout & center() const
border_layout(i_widget &aParent, neogfx::alignment aAlignment=neogfx::alignment::VCenter)
i_spacer & add_spacer() override
size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const override
const i_layout & right() const
void set_autoscale(neogfx::autoscale aAutoscale, bool aUpdateLayout=true) override
border_layout(i_layout &aParent, neogfx::alignment aAlignment=neogfx::alignment::VCenter)
const i_layout & bottom() const
void layout_items(const point &aPosition, const size &aSize) override
size maximum_size(optional_size const &aAvailableSpace=optional_size{}) const override
const i_layout & part(layout_position aPosition) const
uint32_t layout_item_index
Definition i_layout.hpp:35
layout_position
Definition i_layout.hpp:39
#define meta_object(...)
Definition i_object.hpp:28