New UI continued
This commit is contained in:
+1
-1
@@ -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
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user