mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 04:31:34 +08:00
fix some warnings (#660)
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
parent
f64e1e128e
commit
1651ae56ca
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int value = 50;
|
int value = 50;
|
||||||
|
|
||||||
// The tree of components. This defines how to navigate using the keyboard.
|
// The tree of components. This defines how to navigate using the keyboard.
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int value = 50;
|
int value = 50;
|
||||||
|
|
||||||
// The tree of components. This defines how to navigate using the keyboard.
|
// The tree of components. This defines how to navigate using the keyboard.
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
auto on_click = [&] { counter++; };
|
auto on_click = [&] { counter++; };
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int value = 0;
|
int value = 0;
|
||||||
auto action = [&] { value++; };
|
auto action = [&] { value++; };
|
||||||
auto action_renderer =
|
auto action_renderer =
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "ftxui/dom/canvas.hpp" // for Canvas
|
#include "ftxui/dom/canvas.hpp" // for Canvas
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int mouse_x = 0;
|
int mouse_x = 0;
|
||||||
|
@ -8,12 +8,12 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
Component input_list = Container::Vertical({});
|
Component input_list = Container::Vertical({});
|
||||||
std::vector<std::string> items(100, "");
|
std::vector<std::string> items(100, "");
|
||||||
for (int i = 0; i < items.size(); ++i) {
|
for (size_t i = 0; i < items.size(); ++i) {
|
||||||
input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
|
input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::array<bool, 30> states;
|
std::array<bool, 30> states;
|
||||||
|
|
||||||
auto container = Container::Vertical({});
|
auto container = Container::Vertical({});
|
||||||
|
@ -26,7 +26,7 @@ Component Empty() {
|
|||||||
return std::make_shared<ComponentBase>();
|
return std::make_shared<ComponentBase>();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto component =
|
auto component =
|
||||||
Collapsible("Collapsible 1",
|
Collapsible("Collapsible 1",
|
||||||
Inner({
|
Inner({
|
||||||
|
@ -11,7 +11,7 @@ using namespace ftxui;
|
|||||||
|
|
||||||
// An example of how to compose multiple components into one and maintain their
|
// An example of how to compose multiple components into one and maintain their
|
||||||
// interactiveness.
|
// interactiveness.
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto left_count = 0;
|
auto left_count = 0;
|
||||||
auto right_count = 0;
|
auto right_count = 0;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "ftxui/component/loop.hpp" // for Loop
|
#include "ftxui/component/loop.hpp" // for Loop
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::FitComponent();
|
auto screen = ScreenInteractive::FitComponent();
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
std::vector<std::string> entries = {
|
std::vector<std::string> entries = {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
|
||||||
int direction_index = 0;
|
int direction_index = 0;
|
||||||
|
@ -31,7 +31,7 @@ Element make_grid() {
|
|||||||
return gridbox(rows);
|
return gridbox(rows);
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
float focus_x = 0.5f;
|
float focus_x = 0.5f;
|
||||||
float focus_y = 0.5f;
|
float focus_y = 0.5f;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Component Instance(std::string label, Decorator focusCursor) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
screen.Loop(Container::Vertical({
|
screen.Loop(Container::Vertical({
|
||||||
Instance("focus", focus),
|
Instance("focus", focus),
|
||||||
|
@ -23,7 +23,7 @@ Component Wrap(std::string name, Component component) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::FitComponent();
|
auto screen = ScreenInteractive::FitComponent();
|
||||||
|
|
||||||
// -- Menu
|
// -- Menu
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
||||||
#include "ftxui/util/ref.hpp" // for Ref
|
#include "ftxui/util/ref.hpp" // for Ref
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
std::string first_name;
|
std::string first_name;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> entries = {
|
std::vector<std::string> entries = {
|
||||||
"entry 1",
|
"entry 1",
|
||||||
"entry 2",
|
"entry 2",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/component/component_options.hpp" // for MenuOption
|
#include "ftxui/component/component_options.hpp" // for MenuOption
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
|
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ MenuEntryOption Colored(ftxui::Color c) {
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
@ -24,7 +24,7 @@ MenuEntryOption Colored(ftxui::Color c) {
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ Component Window(std::string title, Component component) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int menu_selected[] = {0, 0, 0};
|
int menu_selected[] = {0, 0, 0};
|
||||||
std::vector<std::vector<std::string>> menu_entries = {
|
std::vector<std::vector<std::string>> menu_entries = {
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ Component HMenu3(std::vector<std::string>* entries, int* selected);
|
|||||||
Component HMenu4(std::vector<std::string>* entries, int* selected);
|
Component HMenu4(std::vector<std::string>* entries, int* selected);
|
||||||
Component HMenu5(std::vector<std::string>* entries, int* selected);
|
Component HMenu5(std::vector<std::string>* entries, int* selected);
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
std::vector<std::string> entries{
|
std::vector<std::string> entries{
|
||||||
|
@ -27,7 +27,7 @@ Component Text(const std::string& t) {
|
|||||||
return Renderer([t] { return text(t) | borderEmpty; });
|
return Renderer([t] { return text(t) | borderEmpty; });
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
std::vector<std::string> tab_values{
|
std::vector<std::string> tab_values{
|
||||||
"Tab 1", "Tab 2", "Tab 3", "A very very long tab", "탭",
|
"Tab 1", "Tab 2", "Tab 3", "A very very long tab", "탭",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ void Nested(std::string path) {
|
|||||||
screen.Loop(renderer);
|
screen.Loop(renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::FitComponent();
|
auto screen = ScreenInteractive::FitComponent();
|
||||||
auto button_quit = Button("Quit", screen.ExitLoopClosure());
|
auto button_quit = Button("Quit", screen.ExitLoopClosure());
|
||||||
auto button_nested = Button("Nested", [] { Nested(""); });
|
auto button_nested = Button("Nested", [] { Nested(""); });
|
||||||
|
@ -134,7 +134,7 @@ std::string Stringify(Event event) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
|
||||||
std::vector<Event> keys;
|
std::vector<Event> keys;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> radiobox_list = {
|
std::vector<std::string> radiobox_list = {
|
||||||
"Use gcc",
|
"Use gcc",
|
||||||
"Use clang",
|
"Use clang",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = ScreenInteractive::FitComponent();
|
auto screen = ScreenInteractive::FitComponent();
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
|
||||||
auto middle = Renderer([] { return text("middle") | center; });
|
auto middle = Renderer([] { return text("middle") | center; });
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
int value = 50;
|
int value = 50;
|
||||||
auto slider = Slider("Value:", &value, 0, 100, 1);
|
auto slider = Slider("Value:", &value, 0, 100, 1);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
auto screen = ScreenInteractive::TerminalOutput();
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
std::array<int, 30> values;
|
std::array<int, 30> values;
|
||||||
for (int i = 0; i < values.size(); ++i) {
|
for (int i = 0; i < values.size(); ++i) {
|
||||||
@ -20,10 +20,10 @@ int main(int argc, const char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto layout_horizontal = Container::Horizontal({});
|
auto layout_horizontal = Container::Horizontal({});
|
||||||
for (int i = 0; i < values.size(); ++i) {
|
for (auto& value : values) {
|
||||||
// In C++17:
|
// In C++17:
|
||||||
SliderOption<int> option;
|
SliderOption<int> option;
|
||||||
option.value = &values[i];
|
option.value = &value;
|
||||||
option.max = 100;
|
option.max = 100;
|
||||||
option.increment = 5;
|
option.increment = 5;
|
||||||
option.direction = GaugeDirection::Up;
|
option.direction = GaugeDirection::Up;
|
||||||
|
@ -23,7 +23,7 @@ Element ColorString(int red, int green, int blue) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
int red = 128;
|
int red = 128;
|
||||||
int green = 25;
|
int green = 25;
|
||||||
int blue = 100;
|
int blue = 100;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> tab_values{
|
std::vector<std::string> tab_values{
|
||||||
"tab_1",
|
"tab_1",
|
||||||
"tab_2",
|
"tab_2",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> tab_values{
|
std::vector<std::string> tab_values{
|
||||||
"tab_1",
|
"tab_1",
|
||||||
"tab_2",
|
"tab_2",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::string> toggle_1_entries = {
|
std::vector<std::string> toggle_1_entries = {
|
||||||
"On",
|
"On",
|
||||||
"Off",
|
"Off",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
auto make_boxed = [] {
|
auto make_boxed = [] {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
auto document = vbox({
|
auto document = vbox({
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
auto c = Canvas(100, 100);
|
auto c = Canvas(100, 100);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
|
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
|
||||||
|
|
||||||
// Draw every columns
|
// Draw every columns
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int saturation = 255;
|
int saturation = 255;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
int saturation = 255;
|
int saturation = 255;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = dbox({
|
auto document = dbox({
|
||||||
vbox({
|
vbox({
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto cell = [](const char* t) { return text(t) | border; };
|
auto cell = [](const char* t) { return text(t) | border; };
|
||||||
auto document = //
|
auto document = //
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto make_box = [](int dimx, int dimy) {
|
auto make_box = [](int dimx, int dimy) {
|
||||||
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
|
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "ftxui/screen/box.hpp" // for ftxui
|
#include "ftxui/screen/box.hpp" // for ftxui
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = text("gradient") | center;
|
auto document = text("gradient") | center;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
struct Task {
|
struct Task {
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
#include "ftxui/screen/box.hpp" // for ftxui
|
#include "ftxui/screen/box.hpp" // for ftxui
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
std::string p =
|
std::string p =
|
||||||
R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
|
R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
|
||||||
|
|
||||||
std::string reset_position;
|
std::string reset_position;
|
||||||
for (int i = 0;; ++i) {
|
while (true) {
|
||||||
auto document = vbox({
|
auto document = vbox({
|
||||||
hflow(paragraph(p)),
|
hflow(paragraph(p)),
|
||||||
separator(),
|
separator(),
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = hbox({
|
auto document = hbox({
|
||||||
text("left-column"),
|
text("left-column"),
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/box.hpp" // for ftxui
|
#include "ftxui/screen/box.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
auto document = vbox({
|
auto document = vbox({
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto make_box = [](const std::string& title) {
|
auto make_box = [](const std::string& title) {
|
||||||
return window(text(title) | hcenter | bold,
|
return window(text(title) | hcenter | bold,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = hbox({
|
auto document = hbox({
|
||||||
vbox({
|
vbox({
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
// clang-format off
|
// clang-format off
|
||||||
auto document =
|
auto document =
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = hbox({
|
auto document = hbox({
|
||||||
text("This text is "),
|
text("This text is "),
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
hbox({
|
hbox({
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
auto table = Table({
|
auto table = Table({
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto document = //
|
auto document = //
|
||||||
vbox({
|
vbox({
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto make_box = [](int dimx, int dimy) {
|
auto make_box = [](int dimx, int dimy) {
|
||||||
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
|
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
|
||||||
|
Loading…
Reference in New Issue
Block a user