New UI continued
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ void TextEdit::onEvent(event_t event)
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (cursorPos < length) {
|
||||||
memmove(value + cursorPos + 1, value + cursorPos, length - cursorPos - 1);
|
memmove(value + cursorPos + 1, value + cursorPos, length - cursorPos - 1);
|
||||||
value[cursorPos++] = c;
|
value[cursorPos++] = c;
|
||||||
invalidate();
|
invalidate();
|
||||||
|
|||||||
+14
-14
@@ -65,6 +65,20 @@ class TextEdit : public FormField {
|
|||||||
uint8_t length;
|
uint8_t length;
|
||||||
uint8_t cursorPos = 0;
|
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)
|
static uint8_t getPreviousChar(uint8_t c)
|
||||||
{
|
{
|
||||||
if (c == 'A')
|
if (c == 'A')
|
||||||
@@ -79,20 +93,6 @@ class TextEdit : public FormField {
|
|||||||
return c - 1;
|
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_
|
#endif // _TEXTEDIT_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user