Skip to content

Commit

Permalink
added numeric field as used in examples/GMT_clock
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Dec 27, 2023
1 parent 1cacd5c commit 4ba9b7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class TextField {
TextField(const char vtxt[26], int vxx, int vyy, uint16_t vcc, int valign = ALIGNLEFT, int vsize = eFONTUNSPEC) {
init(vtxt, vxx, vyy, vcc, valign, vsize);
}
// ctor - numeric field
TextField(const int vnum, int vxx, int vyy, uint16_t vcc, int valign = ALIGNLEFT, int vsize = eFONTUNSPEC) {
char temp[sizeof(text)];
snprintf(temp, sizeof(temp), "%d", vnum);
init(temp, vxx, vyy, vcc, valign, vsize);
}
// ctor - text field content specified by a "class String"
TextField(const String vstr, int vxx, int vyy, uint16_t vcc, int valign = ALIGNLEFT, int vsize = eFONTUNSPEC) {
char temp[vstr.length() + 1];
Expand Down

0 comments on commit 4ba9b7f

Please sign in to comment.