mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Introduce CatchEvent (#104)
This commit is contained in:
		| @@ -13,6 +13,7 @@ | ||||
| namespace ftxui { | ||||
|  | ||||
| class ComponentBase; | ||||
| struct Event; | ||||
|  | ||||
| using Component = std::shared_ptr<ComponentBase>; | ||||
| using Components = std::vector<Component>; | ||||
| @@ -30,10 +31,11 @@ Component Input(StringRef content, ConstStringRef placeholder); | ||||
| Component Menu(const std::vector<std::wstring>* entries, int* selected_); | ||||
| Component Radiobox(const std::vector<std::wstring>* entries, int* selected_); | ||||
| Component Toggle(const std::vector<std::wstring>* entries, int* selected); | ||||
| Component Renderer(Component child, std::function<Element()>); | ||||
| Component Renderer(std::function<Element()>); | ||||
| template <class T>  // T = {int, float} | ||||
| Component Slider(StringRef label, T* value, T min, T max, T increment); | ||||
| Component Renderer(Component child, std::function<Element()>); | ||||
| Component Renderer(std::function<Element()>); | ||||
| Component CatchEvent(Component child, std::function<bool(Event)>); | ||||
|  | ||||
| namespace Container { | ||||
| Component Vertical(Components children); | ||||
|   | ||||
| @@ -35,7 +35,6 @@ class Node { | ||||
|   // Step 3: Draw this element. | ||||
|   virtual void Render(Screen& screen); | ||||
|  | ||||
|  | ||||
|  protected: | ||||
|   std::vector<Element> children_; | ||||
|   Requirement requirement_; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Arthur Sonzogni
					Arthur Sonzogni