Euphoria
layoutcontainer.cc
Go to the documentation of this file.
1 #include "gui/layoutcontainer.h"
2 
3 #include "gui/layout.h"
4 
5 
6 namespace eu::gui
7 {
8  std::shared_ptr<Layout>
10  (
11  const std::vector<bool>& expandable_rows,
12  const std::vector<bool>& expandable_cols,
13  float combined_padding
14  )
15  {
16  auto ret = std::shared_ptr<Layout>
17  {
18  new TableLayout
19  (
20  expandable_rows,
21  expandable_cols,
22  combined_padding
23  )
24  };
25  return ret;
26  }
27 
28 
29  std::shared_ptr<Layout>
30  create_single_row_layout(float padding)
31  {
32  auto ret = std::shared_ptr<Layout>{new SingleRowLayout(padding)};
33  return ret;
34  }
35 
36 
38 
39 
41 
42 
43  void
45  {
46  ASSERT(layout);
47  layout->lay_out(&widgets, area);
48  }
49 
50 
51  size2f
53  {
54  ASSERT(layout);
55  return layout->calc_minimum_area(widgets);
56  }
57 }
#define ASSERT(x)
Definition: assert.h:29
std::shared_ptr< Layout > create_single_row_layout(float padding)
std::shared_ptr< Layout > create_table_layout(const std::vector< bool > &expandable_rows, const std::vector< bool > &expandable_cols, float combined_padding)
Definition: rect.h:27
std::vector< std::shared_ptr< Widget > > widgets
Definition: container.h:21
std::shared_ptr< gui::Layout > layout
void lay_out(Rectf area)
size2f calc_minimum_area() const