mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-11-01 02:58:12 +08:00 
			
		
		
		
	Add the slider component.
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| #ifndef FTXUI_COMPONENT_COMPONENT_HPP | ||||
| #define FTXUI_COMPONENT_COMPONENT_HPP | ||||
|  | ||||
| #include <memory> | ||||
| #include "ftxui/component/event.hpp" | ||||
| #include "ftxui/dom/elements.hpp" | ||||
|  | ||||
| @@ -60,6 +61,8 @@ class Component { | ||||
|   std::vector<Component*> children_; | ||||
| }; | ||||
|  | ||||
| using ComponentPtr = std::unique_ptr<Component>; | ||||
|  | ||||
| }  // namespace ftxui | ||||
|  | ||||
| #endif /* end of include guard: FTXUI_COMPONENT_COMPONENT_HPP */ | ||||
|   | ||||
							
								
								
									
										25
									
								
								include/ftxui/component/slider.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								include/ftxui/component/slider.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| #ifndef FTXUI_COMPONENT_SLIDER_HPP | ||||
| #define FTXUI_COMPONENT_SLIDER_HPP | ||||
|  | ||||
| #include <string> | ||||
| #include "ftxui/component/component.hpp" | ||||
|  | ||||
| namespace ftxui { | ||||
| // ComponentPtr Slider(std::string label, | ||||
| // float* value, | ||||
| // float min = 0.f, | ||||
| // float max = 100.f, | ||||
| // float increment = (max - min) * 0.05f); | ||||
|  | ||||
| ComponentPtr Slider(std::wstring label, | ||||
|                     int* value, | ||||
|                     int min, | ||||
|                     int max, | ||||
|                     int increment); | ||||
| }  // namespace ftxui | ||||
|  | ||||
| #endif /* end of include guard: FTXUI_COMPONENT_SLIDER_HPP */ | ||||
|  | ||||
| // Copyright 2020 Arthur Sonzogni. All rights reserved. | ||||
| // Use of this source code is governed by the MIT license that can be found in | ||||
| // the LICENSE file. | ||||
		Reference in New Issue
	
	Block a user
	 ArthurSonzogni
					ArthurSonzogni