Remove more int16_t
This commit is contained in:
+13
-13
@@ -24,8 +24,8 @@
|
||||
class BaseNumberEdit : public FormField
|
||||
{
|
||||
public:
|
||||
BaseNumberEdit(Window * parent, const rect_t &rect, int32_t vmin, int32_t vmax,
|
||||
std::function<int32_t()> getValue, std::function<void(int32_t)> setValue = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0):
|
||||
BaseNumberEdit(Window * parent, const rect_t &rect, int vmin, int vmax,
|
||||
std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0):
|
||||
FormField(parent, rect, windowFlags, textFlags),
|
||||
vmin(vmin),
|
||||
vmax(vmax),
|
||||
@@ -34,17 +34,17 @@ class BaseNumberEdit : public FormField
|
||||
{
|
||||
}
|
||||
|
||||
void setMin(int32_t value)
|
||||
void setMin(int value)
|
||||
{
|
||||
vmin = value;
|
||||
}
|
||||
|
||||
void setMax(int32_t value)
|
||||
void setMax(int value)
|
||||
{
|
||||
vmax = value;
|
||||
}
|
||||
|
||||
void setDefault(int32_t value)
|
||||
void setDefault(int value)
|
||||
{
|
||||
vdefault = value;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class BaseNumberEdit : public FormField
|
||||
return vdefault;
|
||||
}
|
||||
|
||||
void setStep(int32_t value)
|
||||
void setStep(int value)
|
||||
{
|
||||
step = value;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ class BaseNumberEdit : public FormField
|
||||
return step;
|
||||
}
|
||||
|
||||
void setValue(int32_t value)
|
||||
void setValue(int value)
|
||||
{
|
||||
_setValue(limit(vmin, value, vmax));
|
||||
invalidate();
|
||||
@@ -91,11 +91,11 @@ class BaseNumberEdit : public FormField
|
||||
}
|
||||
|
||||
protected:
|
||||
int32_t vdefault = 0;
|
||||
int32_t vmin;
|
||||
int32_t vmax;
|
||||
int32_t step = 1;
|
||||
std::function<int32_t()> _getValue;
|
||||
std::function<void(int32_t)> _setValue;
|
||||
int vdefault = 0;
|
||||
int vmin;
|
||||
int vmax;
|
||||
int step = 1;
|
||||
std::function<int()> _getValue;
|
||||
std::function<void(int)> _setValue;
|
||||
};
|
||||
|
||||
|
||||
+8
-8
@@ -21,8 +21,8 @@
|
||||
#include "menu.h"
|
||||
#include "theme.h"
|
||||
|
||||
Choice::Choice(FormGroup * parent, const rect_t & rect, int16_t vmin, int16_t vmax,
|
||||
std::function<int16_t()> getValue, std::function<void(int16_t)> setValue, WindowFlags windowFlags) :
|
||||
Choice::Choice(FormGroup * parent, const rect_t & rect, int vmin, int vmax,
|
||||
std::function<int()> getValue, std::function<void(int)> setValue, WindowFlags windowFlags) :
|
||||
ChoiceBase(parent, rect, CHOICE_TYPE_DROPOWN, windowFlags),
|
||||
vmin(vmin),
|
||||
vmax(vmax),
|
||||
@@ -31,8 +31,8 @@ Choice::Choice(FormGroup * parent, const rect_t & rect, int16_t vmin, int16_t vm
|
||||
{
|
||||
}
|
||||
|
||||
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) :
|
||||
Choice::Choice(FormGroup * parent, const rect_t & rect, const char * const values[], int vmin, int vmax,
|
||||
std::function<int()> getValue, std::function<void(int)> setValue, WindowFlags windowFlags) :
|
||||
ChoiceBase(parent, rect, CHOICE_TYPE_DROPOWN, windowFlags),
|
||||
vmin(vmin),
|
||||
vmax(vmax),
|
||||
@@ -42,8 +42,8 @@ Choice::Choice(FormGroup * parent, const rect_t & rect, const char * const value
|
||||
setValues(values);
|
||||
}
|
||||
|
||||
Choice::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, WindowFlags windowFlags) :
|
||||
Choice::Choice(FormGroup * parent, const rect_t & rect, std::vector<std::string> values, int vmin, int vmax,
|
||||
std::function<int()> getValue, std::function<void(int)> setValue, WindowFlags windowFlags) :
|
||||
ChoiceBase(parent, rect, CHOICE_TYPE_DROPOWN, windowFlags),
|
||||
values(std::move(values)),
|
||||
vmin(vmin),
|
||||
@@ -53,8 +53,8 @@ Choice::Choice(FormGroup * parent, const rect_t & rect, std::vector<std::string>
|
||||
{
|
||||
}
|
||||
|
||||
Choice::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, WindowFlags windowFlags) :
|
||||
Choice::Choice(FormGroup * parent, const rect_t & rect, const char * values, int vmin, int vmax,
|
||||
std::function<int()> getValue, std::function<void(int)> setValue, WindowFlags windowFlags) :
|
||||
ChoiceBase(parent, rect, CHOICE_TYPE_DROPOWN, windowFlags),
|
||||
vmin(vmin),
|
||||
vmax(vmax),
|
||||
|
||||
+13
-12
@@ -27,7 +27,8 @@ enum ChoiceType {
|
||||
CHOICE_TYPE_FOLDER,
|
||||
};
|
||||
|
||||
class ChoiceBase : public FormField {
|
||||
class ChoiceBase : public FormField
|
||||
{
|
||||
public:
|
||||
ChoiceBase(FormGroup * parent, const rect_t & rect, ChoiceType type = CHOICE_TYPE_DROPOWN, WindowFlags windowFlags = 0):
|
||||
FormField(parent, rect, windowFlags),
|
||||
@@ -46,10 +47,10 @@ class ChoiceBase : public FormField {
|
||||
|
||||
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 * 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);
|
||||
Choice(FormGroup * parent, const rect_t & rect, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0);
|
||||
Choice(FormGroup * parent, const rect_t & rect, std::vector<std::string> values, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0);
|
||||
Choice(FormGroup * parent, const rect_t & rect, const char * const values[], int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0);
|
||||
Choice(FormGroup * parent, const rect_t & rect, const char * values, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0);
|
||||
|
||||
void addValue(const char * value);
|
||||
|
||||
@@ -133,13 +134,13 @@ class Choice : public ChoiceBase {
|
||||
menuTitle = std::move(value);
|
||||
}
|
||||
|
||||
void setMin(int16_t value)
|
||||
void setMin(int value)
|
||||
{
|
||||
vmin = value;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void setMax(int16_t value)
|
||||
void setMax(int value)
|
||||
{
|
||||
vmax = value;
|
||||
invalidate();
|
||||
@@ -147,13 +148,13 @@ class Choice : public ChoiceBase {
|
||||
|
||||
protected:
|
||||
std::vector<std::string> values;
|
||||
int16_t vmin = 0;
|
||||
int16_t vmax = 0;
|
||||
int vmin = 0;
|
||||
int vmax = 0;
|
||||
std::string menuTitle;
|
||||
std::function<int16_t()> getValue;
|
||||
std::function<void(int16_t)> setValue;
|
||||
std::function<int()> getValue;
|
||||
std::function<void(int)> setValue;
|
||||
std::function<bool(int)> isValueAvailable;
|
||||
std::function<std::string(int32_t)> textHandler;
|
||||
std::function<std::string(int)> textHandler;
|
||||
|
||||
virtual void openMenu();
|
||||
};
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
#include "choice.h"
|
||||
#include <string>
|
||||
|
||||
class FileChoice: public ChoiceBase {
|
||||
class FileChoice: public ChoiceBase
|
||||
{
|
||||
public:
|
||||
FileChoice(FormGroup * parent, const rect_t & rect, std::string folder, const char * extension, int maxlen, std::function<std::string()> getValue, std::function<void(std::string)> setValue);
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
#include "keyboard_number.h"
|
||||
#endif
|
||||
|
||||
NumberEdit::NumberEdit(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax, std::function<int32_t()> getValue, std::function<void(int32_t)> setValue, WindowFlags windowFlags, LcdFlags textFlags):
|
||||
NumberEdit::NumberEdit(Window * parent, const rect_t & rect, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue, WindowFlags windowFlags, LcdFlags textFlags):
|
||||
BaseNumberEdit(parent, rect, vmin, vmax, std::move(getValue), std::move(setValue), windowFlags, textFlags)
|
||||
{
|
||||
}
|
||||
|
||||
+5
-5
@@ -22,10 +22,10 @@
|
||||
#include "basenumberedit.h"
|
||||
#include <string>
|
||||
|
||||
class NumberEdit : public BaseNumberEdit {
|
||||
class NumberEdit : public BaseNumberEdit
|
||||
{
|
||||
public:
|
||||
NumberEdit(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax,
|
||||
std::function<int32_t()> getValue, std::function<void(int32_t)> setValue = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0);
|
||||
NumberEdit(Window * parent, const rect_t & rect, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> setValue = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0);
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
std::string getName() const override
|
||||
@@ -56,7 +56,7 @@ class NumberEdit : public BaseNumberEdit {
|
||||
zeroText = std::move(value);
|
||||
}
|
||||
|
||||
void setDisplayHandler(std::function<void(BitmapBuffer *, LcdFlags, int32_t)> function)
|
||||
void setDisplayHandler(std::function<void(BitmapBuffer *, LcdFlags, int)> function)
|
||||
{
|
||||
displayFunction = std::move(function);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class NumberEdit : public BaseNumberEdit {
|
||||
void onFocusLost() override;
|
||||
|
||||
protected:
|
||||
std::function<void(BitmapBuffer *, LcdFlags, int32_t)> displayFunction;
|
||||
std::function<void(BitmapBuffer *, LcdFlags, int)> displayFunction;
|
||||
std::string prefix;
|
||||
std::string suffix;
|
||||
std::string zeroText;
|
||||
|
||||
+4
-4
@@ -33,13 +33,13 @@ constexpr coord_t SCROLL_POSITION_INVALIDATED = INT_MIN;
|
||||
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):
|
||||
Roller(FormGroup * parent, const rect_t & rect, const char * label, const char * const * values, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> 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):
|
||||
Roller(FormGroup * parent, const rect_t & rect, const char * label, std::vector<std::string> values, int vmin, int vmax, std::function<int()> getValue, std::function<void(int)> 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);
|
||||
@@ -127,14 +127,14 @@ class Roller: public Choice
|
||||
}
|
||||
|
||||
// virtual not needed until now
|
||||
void setMin(int16_t value)
|
||||
void setMin(int value)
|
||||
{
|
||||
Choice::setMin(value);
|
||||
invalidateScrollPosition();
|
||||
}
|
||||
|
||||
// virtual not needed until now
|
||||
void setMax(int16_t value)
|
||||
void setMax(int value)
|
||||
{
|
||||
Choice::setMax(value);
|
||||
invalidateScrollPosition();
|
||||
|
||||
+4
-4
@@ -23,7 +23,7 @@
|
||||
|
||||
class Slider: public FormField {
|
||||
public:
|
||||
Slider(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax, std::function<int32_t()> getValue, std::function<void(int32_t)> setValue):
|
||||
Slider(Window * parent, const rect_t & rect, int32_t vmin, int32_t vmax, std::function<int()> getValue, std::function<void(int)> setValue):
|
||||
FormField(parent, rect),
|
||||
vmin(vmin),
|
||||
vmax(vmax),
|
||||
@@ -39,7 +39,7 @@ class Slider: public FormField {
|
||||
}
|
||||
#endif
|
||||
|
||||
void setValue(int32_t value)
|
||||
void setValue(int value)
|
||||
{
|
||||
_setValue(limit(vmin, value, vmax));
|
||||
invalidate();
|
||||
@@ -64,7 +64,7 @@ class Slider: public FormField {
|
||||
int32_t vmin;
|
||||
int32_t vmax;
|
||||
bool sliding = false;
|
||||
std::function<int32_t()> getValue;
|
||||
std::function<void(int32_t)> _setValue;
|
||||
std::function<int()> getValue;
|
||||
std::function<void(int)> _setValue;
|
||||
};
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@
|
||||
#include "libopenui_config.h"
|
||||
#include "font.h"
|
||||
|
||||
class Table: public FormField {
|
||||
class Table: public FormField
|
||||
{
|
||||
public:
|
||||
class Cell {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user