21 int direction_index = 0;
23 int justify_content_index = 0;
24 int align_items_index = 0;
25 int align_content_index = 0;
27 std::vector<std::string> directions = {
34 std::vector<std::string> wraps = {
40 std::vector<std::string> justify_content = {
41 "フレックス開始",
"フレックス終了",
"中央",
"ストレッチ",
42 "均等配置(間隔あり)",
"均等配置(周囲間隔あり)",
"均等配置(均等間隔)",
45 std::vector<std::string> align_items = {
52 std::vector<std::string> align_content = {
53 "フレックス開始",
"フレックス終了",
"中央",
"ストレッチ",
54 "均等配置(間隔あり)",
"均等配置(周囲間隔あり)",
"均等配置(均等間隔)",
57 auto radiobox_direction =
Radiobox(&directions, &direction_index);
58 auto radiobox_wrap =
Radiobox(&wraps, &wrap_index);
59 auto radiobox_justify_content =
60 Radiobox(&justify_content, &justify_content_index);
61 auto radiobox_align_items =
Radiobox(&align_items, &align_items_index);
62 auto radiobox_align_content =
Radiobox(&align_content, &align_content_index);
64 bool element_xflex_grow =
false;
65 bool element_yflex_grow =
false;
66 bool group_xflex_grow =
true;
67 bool group_yflex_grow =
true;
68 auto checkbox_element_xflex_grow =
69 Checkbox(
"要素 |= xflex_grow", &element_xflex_grow);
70 auto checkbox_element_yflex_grow =
71 Checkbox(
"要素 |= yflex_grow", &element_yflex_grow);
72 auto checkbox_group_xflex_grow =
73 Checkbox(
"グループ |= xflex_grow", &group_xflex_grow);
74 auto checkbox_group_yflex_grow =
75 Checkbox(
"グループ |= yflex_grow", &group_yflex_grow);
77 auto make_box = [&](
size_t dimx,
size_t dimy,
size_t index) {
78 std::string title = std::to_string(dimx) +
"x" + std::to_string(dimy);
79 auto element =
window(
text(title) | hcenter | bold,
80 text(std::to_string(index)) | hcenter | dim) |
84 if (element_xflex_grow) {
87 if (element_yflex_grow) {
93 auto content_renderer =
Renderer([&] {
123 if (!group_xflex_grow) {
126 if (!group_yflex_grow) {
130 group = group |
flex;
137 int space_right = 10;
138 int space_bottom = 1;
141 content_renderer, &space_right);
144 content_renderer, &space_bottom);
146 auto main_container = Container::Vertical({
147 Container::Horizontal({
150 Container::Vertical({
151 checkbox_element_xflex_grow,
152 checkbox_element_yflex_grow,
153 checkbox_group_xflex_grow,
154 checkbox_group_yflex_grow,
157 Container::Horizontal({
158 radiobox_justify_content,
159 radiobox_align_items,
160 radiobox_align_content,
165 auto main_renderer =
Renderer(main_container, [&] {
169 radiobox_direction->
Render()),
173 checkbox_element_xflex_grow->Render(),
174 checkbox_element_yflex_grow->Render(),
175 checkbox_group_xflex_grow->Render(),
176 checkbox_group_yflex_grow->Render(),
181 radiobox_justify_content->
Render()),
183 radiobox_align_items->
Render()),
185 radiobox_align_content->
Render()),
187 content_renderer->Render() | flex |
border,
191 screen.Loop(main_renderer);