Roller new constructor

This commit is contained in:
Bertrand Songis
2020-05-13 09:26:15 +02:00
parent 39c2fe6f16
commit 2e786b475a
+11 -1
View File
@@ -33,6 +33,17 @@ class Roller: public Choice {
public:
Roller(FormGroup * parent, const rect_t & rect, const char * label, const char * const * values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES):
Choice(parent, rect, values, vmin, vmax, std::move(getValue), std::move(setValue), windowFlags | NO_SCROLLBAR)
{
init(label);
}
Roller(FormGroup * parent, const rect_t & rect, const char * label, std::vector<std::string> values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES):
Choice(parent, rect, std::move(values), vmin, vmax, std::move(getValue), std::move(setValue), windowFlags | NO_SCROLLBAR)
{
init(label);
}
void init(const char * label)
{
if (label) {
// the label is another window, could be changed, but is it needed?
@@ -46,7 +57,6 @@ class Roller: public Choice {
lastScrollPositionY = scrollPositionY;
}
#if defined(DEBUG_WINDOWS)
std::string getName() const override
{