1+ #include < cstddef>
2+ #include < exception>
13#include < format>
24#include < string>
35#include < vector>
46
5- #include " ftxui/component/captured_mouse.hpp" // for ftxui
67#include " ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
78#include " ftxui/component/component_base.hpp" // for ComponentBase, Component
89#include " ftxui/component/screen_interactive.hpp" // for ScreenInteractive
910#include " ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
10- #include " ftxui/dom/table.hpp" // for operator|, separator, text, Element, flex, vbox, border
1111
1212#include < cons_expr/cons_expr.hpp>
1313#include < cons_expr/utility.hpp>
1414
1515#include < internal_use_only/config.hpp>
1616
17+ static constexpr int InitialSplitWidth = 50 ;
18+ static constexpr int GlobalsHeight = 5 ;
19+ static constexpr int ValuesHeight = 7 ;
1720
1821int main ([[maybe_unused]] int argc, [[maybe_unused]] const char *argv[])
1922{
@@ -38,19 +41,19 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] const char *argv[])
3841
3942 auto update_objects = [&]() {
4043 entries.clear ();
41- for (std::size_t index = 0 ; auto item : evaluator.values [{ 0 , evaluator.values .size () }]) {
44+ for (std::size_t index = 0 ; auto item : evaluator.values [{ . start = 0 , . size = evaluator.values .size () }]) {
4245 entries.push_back (std::format (" {}: {}" , index, to_string (evaluator, true , item)));
4346 ++index;
4447 }
4548
4649 characters.clear ();
47- for (std::size_t index = 0 ; auto item : evaluator.strings [{ 0 , evaluator.strings .size () }]) {
50+ for (std::size_t index = 0 ; auto item : evaluator.strings [{ . start = 0 , . size = evaluator.strings .size () }]) {
4851 characters.push_back (std::format (" {}: '{}'" , index, item));
4952 ++index;
5053 }
5154
5255 globals.clear ();
53- for (auto [key, value] : evaluator.global_scope [{ 0 , evaluator.global_scope .size () }]) {
56+ for (auto [key, value] : evaluator.global_scope [{ . start = 0 , . size = evaluator.global_scope .size () }]) {
5457 globals.push_back (std::format (" {}: '{}'" , to_string (evaluator, false , key), to_string (evaluator, true , value)));
5558 }
5659 };
@@ -77,7 +80,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] const char *argv[])
7780
7881
7982 auto button = ftxui::Button (" Evaluate" , do_evaluate);
80- int size = 50 ;
83+ int size = InitialSplitWidth ;
8184 auto resizeable_bits = ftxui::ResizableSplitLeft (textarea_1, output_1, &size);
8285
8386 auto radiobox = ftxui::Menu (&entries, &selected);
@@ -113,10 +116,10 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] const char *argv[])
113116 return ftxui::hbox ({ characterbox->Render () | ftxui::vscroll_indicator | ftxui::frame,
114117 ftxui::separator (),
115118 ftxui::vbox ({ globalsbox->Render () | ftxui::vscroll_indicator | ftxui::frame
116- | ftxui::size (ftxui::HEIGHT, ftxui::EQUAL, 5 ),
119+ | ftxui::size (ftxui::HEIGHT, ftxui::EQUAL, GlobalsHeight ),
117120 ftxui::separator (),
118121 radiobox->Render () | ftxui::vscroll_indicator | ftxui::frame
119- | ftxui::size (ftxui::HEIGHT, ftxui::EQUAL, 7 ),
122+ | ftxui::size (ftxui::HEIGHT, ftxui::EQUAL, ValuesHeight ),
120123 ftxui::separator (),
121124 resizeable_bits->Render () | ftxui::flex,
122125 ftxui::separator (),
0 commit comments