Files
FTXUI/ftxui/include/ftxui/component/menu.hpp
Arthur Sonzogni 711b71688e Implement a lot of new features.
This commit deserve to be cut into at least 8 sub commit. Sorry, I
acknowledge this is bad... Here are the new features:

 * dom decorator: bold, dim, underlined, inverted.
 * component mechanism
 * components
   * menu
   * toogle
2018-10-09 19:08:55 +02:00

32 lines
639 B
C++

#ifndef FTXUI_COMPONENT_MENU
#define FTXUI_COMPONENT_MENU
#include "ftxui/component/component.hpp"
#include <functional>
namespace ftxui {
namespace component {
class Menu : public Component {
public:
// Constructor.
Menu(Delegate*);
// State.
std::vector<std::wstring> entries = {};
int selected = 0;
// State update callback.
std::function<void()> on_change = [](){};
std::function<void()> on_enter = [](){};
// Component implementation.
dom::Element Render() override;
bool Event(int key) override;
};
} // namespace component
} // namespace ftxui
#endif /* end of include guard: FTXUI_COMPONENT_MENU */