diff --git a/examples/dom/CMakeLists.txt b/examples/dom/CMakeLists.txt index 7a4ff10f50d1bf27a845d53dbed5e24459a93692..437b1f7d809ff246c76f4ac50c6c8d289781dd24 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 0000000000000000000000000000000000000000..4214a7db0db74e0ce5db2c526453f51f5332e771 --- /dev/null +++ b/examples/dom/blink.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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 0000000000000000000000000000000000000000..1a03b83c875cfc606f1da109f9d50822f3b8e3d5 --- /dev/null +++ b/examples/dom/bold.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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 0000000000000000000000000000000000000000..a838643376ce4f464842afb908076a4d294ec6c9 --- /dev/null +++ b/examples/dom/dim.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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 0000000000000000000000000000000000000000..176dd6dd9609e126f1907cc513b85620c36b541d --- /dev/null +++ b/examples/dom/inverted.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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 0000000000000000000000000000000000000000..f44df662e136c046790e23e87d88a8966d2b3df2 --- /dev/null +++ b/examples/dom/style_gallery.cpp @@ -0,0 +1,26 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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 0000000000000000000000000000000000000000..9f50dd2a72fa0b53219b851c5a1bc53e4899a6ad --- /dev/null +++ b/examples/dom/underlined.cpp @@ -0,0 +1,21 @@ +#include "ftxui/screen.hpp" +#include "ftxui/dom/elements.hpp" +#include <iostream> + +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; +}