FifeGUI 0.3.0
A C++ GUI library designed for games.
flowcontainer.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_WIDGETS_FLOWCONTAINER_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_FLOWCONTAINER_HPP_
7
8// Platform config include
9#include "fifechan/platform.hpp"
10
11// Project headers (subdirs before local)
12#include "fifechan/widgets/container.hpp"
13
14namespace fcn
15{
21 class FIFEGUI_API FlowContainer : public Container
22 {
23 public:
29 enum class Alignment : uint8_t
30 {
31 Left = 0,
32 Right,
33 Top,
34 Bottom,
35 Center
36 };
37
39
40 ~FlowContainer() override;
41
42 FlowContainer(FlowContainer const &) = delete;
43 FlowContainer& operator=(FlowContainer const &) = delete;
44 FlowContainer(FlowContainer&&) = delete;
45 FlowContainer& operator=(FlowContainer&&) = delete;
46
53 virtual void setAlignment(FlowContainer::Alignment alignment);
54
61 virtual FlowContainer::Alignment getAlignment() const;
62
68 virtual void adjustContent();
69
70 // Inherited from Container
71
74
75 void setLayout(Container::LayoutPolicy policy) override;
76
82 void resizeToContent(bool recursion = true) override;
83
89 void expandContent(bool recursion) override;
90
91 protected:
95 Alignment mAlignment{Alignment::Center};
96 };
97} // namespace fcn
98
99#endif // INCLUDE_FIFECHAN_WIDGETS_FLOWCONTAINER_HPP_
Container()
Constructor.
void resizeToContent(bool recursion=true) override
Resize this container to fit its children.
void expandContent(bool recursion) override
Expand children to occupy available space in this container.
LayoutPolicy
The layout policy of the container.
Definition container.hpp:50
An implementation of a flow container that can contain other widgets.
Alignment mAlignment
Current alignment used when laying out child widgets.
Alignment
Alignments for widgets.
Used replacement tokens by configure_file():