mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Menu of components (#131)
Allow Container::Vertical and Container::Horizontal to have an external selector, similar to Container::Tab. This is useful for implementing a menu of menu. Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
		| @@ -39,7 +39,9 @@ Component CatchEvent(Component child, std::function<bool(Event)>); | ||||
|  | ||||
| namespace Container { | ||||
| Component Vertical(Components children); | ||||
| Component Vertical(Components children, int* selector); | ||||
| Component Horizontal(Components children); | ||||
| Component Horizontal(Components children, int* selector); | ||||
| Component Tab(Components children, int* selector); | ||||
|  | ||||
| }  // namespace Container | ||||
|   | ||||
| @@ -13,9 +13,11 @@ class ContainerBase : public ComponentBase { | ||||
|  public: | ||||
|   static Component Vertical(); | ||||
|   static Component Vertical(Components children); | ||||
|   static Component Vertical(Components children, int* selector); | ||||
|  | ||||
|   static Component Horizontal(); | ||||
|   static Component Horizontal(Components children); | ||||
|   static Component Horizontal(Components children, int* selector); | ||||
|  | ||||
|   static Component Tab(int* selector); | ||||
|   static Component Tab(Components children, int* selector); | ||||
| @@ -44,6 +46,7 @@ class ContainerBase : public ComponentBase { | ||||
|  | ||||
|   int selected_ = 0; | ||||
|   int* selector_ = nullptr; | ||||
|   bool is_tab_ = false; | ||||
|  | ||||
|  private: | ||||
|   bool OnMouseEvent(Event event); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Shreyas Atre
					Shreyas Atre