51 create(
const T& val,
const std::string& prefix,
const std::string& name)
59 namespace hana = boost::hana;
60 static constexpr auto accessors = hana::accessors<T>();
62 auto [widget, addChildren] = [&]
64 static constexpr bool grpbox = std::is_same_v<layout_t, RemoteGui::GroupBox>;
65 static constexpr bool sgrid = std::is_same_v<layout_t, RemoteGui::SimpleGridLayout>;
66 static constexpr bool vbox = std::is_same_v<layout_t, RemoteGui::VBoxLayout>;
67 static constexpr bool hbox = std::is_same_v<layout_t, RemoteGui::HBoxLayout>;
69 if constexpr (grpbox || sgrid)
71 RemoteGui::SimpleGridLayoutPtr l =
new RemoteGui::SimpleGridLayout;
73 auto add = [l](
const auto& cs)
77 l->children.emplace_back(
new RemoteGui::Widget);
78 l->children.emplace_back(cs.front());
82 l->children.insert(l->children.end(), cs.begin(), cs.end());
87 return std::make_pair(
93 return std::make_pair(l, add);
96 else if constexpr (vbox || hbox)
98 RemoteGui::WidgetPtr l =
new layout_t;
99 auto add = [l](
const auto& cs)
100 { l->children.insert(l->children.end(), cs.begin(), cs.end()); };
101 return std::make_pair(l, add);
105 static_assert(!std::is_same_v<T, T>,
106 "the given type for config_layout can't be used");
110 hana::for_each(accessors,
111 [&, addChildren = std::ref(addChildren)](
auto& e)
115 if constexpr (!elem_det::no_remote_gui)