Cosmetics

This commit is contained in:
Bertrand Songis
2020-05-07 09:51:28 +02:00
parent dd9a87aa5f
commit 77900db310
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ Choice::Choice(FormGroup * parent, const rect_t & rect, int16_t vmin, int16_t vm
{
}
Choice::Choice(FormGroup * parent, const rect_t & rect, const char * values[], int16_t vmin, int16_t vmax,
Choice::Choice(FormGroup * parent, const rect_t & rect, const char * const values[], int16_t vmin, int16_t vmax,
std::function<int16_t()> getValue, std::function<void(int16_t)> setValue, WindowFlags windowFlags) :
ChoiceBase(parent, rect, CHOICE_TYPE_DROPOWN, windowFlags),
vmin(vmin),
@@ -40,7 +40,7 @@ Choice::Choice(FormGroup * parent, const rect_t & rect, const char * values[], i
setValue(std::move(setValue))
{
if (values) {
const char ** value = &values[0];
auto value = &values[0];
for (int i = vmin; i <= vmax; i++) {
this->values.emplace_back(*value++);
}
+1 -1
View File
@@ -49,7 +49,7 @@ class Choice : public ChoiceBase {
public:
Choice(FormGroup * parent, const rect_t & rect, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = 0);
Choice(FormGroup * parent, const rect_t & rect, 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 = 0);
Choice(FormGroup * parent, const rect_t & rect, const char * values[], int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = 0);
Choice(FormGroup * parent, const rect_t & rect, const char * const values[], int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = 0);
Choice(FormGroup * parent, const rect_t & rect, const char * values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = 0);
void addItem(const char * item);
+1 -1
View File
@@ -31,7 +31,7 @@ constexpr WindowFlags ROLLER_SEPARATION_LINES = (FORM_FLAGS_LAST << 1u);
class Roller: public Choice {
public:
Roller(FormGroup * parent, const rect_t & rect, const char * label, const char ** values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES):
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)
{
if (label) {