New UI continued

This commit is contained in:
Bertrand Songis
2019-10-05 19:01:56 +02:00
parent a9bce97bdd
commit f23021226d
2 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ void TextEdit::onEvent(event_t event)
invalidate();
}
}
else {
else if (cursorPos < length) {
memmove(value + cursorPos + 1, value + cursorPos, length - cursorPos - 1);
value[cursorPos++] = c;
invalidate();
+14 -14
View File
@@ -65,6 +65,20 @@ class TextEdit : public FormField {
uint8_t length;
uint8_t cursorPos = 0;
static uint8_t getNextChar(uint8_t c)
{
if (c == ' ' || c == 0)
return 'A';
else if (c == 'Z')
return 'a';
else if (c == 'z')
return '0';
else if (c == '>')
return ' ';
else
return c + 1;
}
static uint8_t getPreviousChar(uint8_t c)
{
if (c == 'A')
@@ -79,20 +93,6 @@ class TextEdit : public FormField {
return c - 1;
}
static uint8_t getNextChar(uint8_t c)
{
if (c == ' ')
return 'A';
else if (c == 'Z')
return 'a';
else if (c == 'z')
return '0';
else if (c == '>')
return ' ';
else
return c + 1;
}
};
#endif // _TEXTEDIT_H_