mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-22 04:38:09 +08:00
Introduce Options and use them for Menu.
Introduce Options for components. This allows me to add new features, without updating functions signatures.
This commit is contained in:

committed by
Arthur Sonzogni

parent
82adc3b410
commit
cd84b187b3
@@ -7,8 +7,9 @@
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/component/component_base.hpp"
|
||||
#include "ftxui/component/component_options.hpp"
|
||||
#include "ftxui/dom/elements.hpp" // for Element
|
||||
#include "ftxui/screen/string.hpp" // for ConstStringRef, StringRef
|
||||
#include "ftxui/util/ref.hpp" // for ConstStringRef, StringRef
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
@@ -28,7 +29,9 @@ Component Button(ConstStringRef label,
|
||||
bool border = true);
|
||||
Component Checkbox(ConstStringRef label, bool* checked);
|
||||
Component Input(StringRef content, ConstStringRef placeholder);
|
||||
Component Menu(const std::vector<std::wstring>* entries, int* selected_);
|
||||
Component Menu(const std::vector<std::wstring>* entries,
|
||||
int* selected_,
|
||||
ConstRef<MenuOption> = {});
|
||||
Component Radiobox(const std::vector<std::wstring>* entries, int* selected_);
|
||||
Component Toggle(const std::vector<std::wstring>* entries, int* selected);
|
||||
template <class T> // T = {int, float, long}
|
||||
|
Reference in New Issue
Block a user