diff --git a/examples/dom/CMakeLists.txt b/examples/dom/CMakeLists.txt index 7a4ff10..437b1f7 100644 --- a/examples/dom/CMakeLists.txt +++ b/examples/dom/CMakeLists.txt @@ -1,7 +1,13 @@ +example(blink) +example(bold) example(color) example(dbox) +example(dim) example(frame) example(gauge) +example(inverted) example(package_manager) example(separator) +example(underlined) +example(style_gallery) example(vbox_hbox) diff --git a/examples/dom/blink.cpp b/examples/dom/blink.cpp new file mode 100644 index 0000000..4214a7d --- /dev/null +++ b/examples/dom/blink.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"This text is "), + text(L"blink") | blink, + text(L". Do you like it?") + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +} diff --git a/examples/dom/bold.cpp b/examples/dom/bold.cpp new file mode 100644 index 0000000..1a03b83 --- /dev/null +++ b/examples/dom/bold.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"This text is "), + text(L"bold") | bold, + text(L". Do you like it?") + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +} diff --git a/examples/dom/dim.cpp b/examples/dom/dim.cpp new file mode 100644 index 0000000..a838643 --- /dev/null +++ b/examples/dom/dim.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"This text is "), + text(L"dim") | dim, + text(L". Do you like it?") + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +} diff --git a/examples/dom/inverted.cpp b/examples/dom/inverted.cpp new file mode 100644 index 0000000..176dd6d --- /dev/null +++ b/examples/dom/inverted.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"This text is "), + text(L"inverted") | inverted, + text(L". Do you like it?") + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +} diff --git a/examples/dom/style_gallery.cpp b/examples/dom/style_gallery.cpp new file mode 100644 index 0000000..f44df66 --- /dev/null +++ b/examples/dom/style_gallery.cpp @@ -0,0 +1,26 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"normal") , text(L" ") , + text(L"bold") | bold , text(L" ") , + text(L"dim") | dim , text(L" ") , + text(L"inverted") | inverted , text(L" ") , + text(L"underlined")| underlined , text(L" ") , + text(L"blink") | blink , text(L" ") , + text(L"color") | color(Color::Blue) , text(L" ") , + text(L"bgcolor") | bgcolor(Color::Blue) + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +} diff --git a/examples/dom/underlined.cpp b/examples/dom/underlined.cpp new file mode 100644 index 0000000..9f50dd2 --- /dev/null +++ b/examples/dom/underlined.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include + +int main(int argc, const char *argv[]) +{ + using namespace ftxui; + using namespace ftxui::dom; + auto document = + hbox( + text(L"This text is "), + text(L"underlined") | underlined, + text(L". Do you like it?") + ); + auto screen = ftxui::Screen::TerminalOutput(document); + Render(screen, document.get()); + + std::cout << screen.ToString(); + + return 0; +}