Add the slider component.

This commit is contained in:
ArthurSonzogni
2021-04-29 00:18:58 +02:00
parent 7d132c6225
commit 0af8201023
6 changed files with 192 additions and 2 deletions

View File

@@ -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 */

View 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.