From 2c0cab26543e698602d244dc59add9924ae5f4b0 Mon Sep 17 00:00:00 2001 From: Krishna-13-cyber Date: Sat, 8 Apr 2023 22:01:07 +0530 Subject: [PATCH] Add Dropdown Component Signed-off-by: Krishna Narayanan --- examples/Dropdown.qf | 13 +++++++++++++ include/quick-ftxui.hpp | 27 +++++++++++++++++++++++++-- tests/test1.cpp | 8 ++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 examples/Dropdown.qf diff --git a/examples/Dropdown.qf b/examples/Dropdown.qf new file mode 100644 index 0000000..02129f3 --- /dev/null +++ b/examples/Dropdown.qf @@ -0,0 +1,13 @@ +Vertical{ + Dropdown{ + [ "Physics" "Maths" "Chemistry" "Biology"], + 0 + } + Slider{ + "Slider 1: ", + 50, + 0, + 100, + 1 + } +} \ No newline at end of file diff --git a/include/quick-ftxui.hpp b/include/quick-ftxui.hpp index b57862c..4554e79 100644 --- a/include/quick-ftxui.hpp +++ b/include/quick-ftxui.hpp @@ -33,13 +33,14 @@ struct expression; struct input; struct slider; struct menu; +struct dropdown; enum block_alignment { VERTICAL, HORIZONTAL }; typedef boost::variant< nil, boost::recursive_wrapper