tcMenu
Toggle main menu visibility
Loading...
Searching...
No Matches
src
RuntimeMenuItem.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
3
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4
*/
5
10
11
#ifndef _RUNTIME_MENUITEM_H_
12
#define _RUNTIME_MENUITEM_H_
13
14
#include "
MenuItems.h
"
15
#include "
tcUtil.h
"
16
18
#ifndef RANDOM_ID_START
19
#define RANDOM_ID_START 30000
20
#endif
21
23
menuid_t
nextRandomId
();
24
26
int
textItemRenderFn
(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
27
29
int
ipAddressRenderFn
(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
30
32
int
backSubItemRenderFn
(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
33
35
int
timeItemRenderFn
(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
36
38
int
dateItemRenderFn
(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
39
43
enum
MultiEditWireType
: uint8_t {
45
EDITMODE_PLAIN_TEXT
= 0,
47
EDITMODE_IP_ADDRESS
= 1,
49
EDITMODE_TIME_24H
= 2,
51
EDITMODE_TIME_12H
= 3,
53
EDITMODE_TIME_HUNDREDS_24H
= 4,
55
EDITMODE_GREGORIAN_DATE
= 5,
57
EDITMODE_TIME_DURATION_SECONDS
= 6,
59
EDITMODE_TIME_DURATION_HUNDREDS
= 7,
61
EDITMODE_TIME_24H_HHMM
= 8,
63
EDITMODE_TIME_12H_HHMM
= 9,
64
};
65
72
class
RuntimeMenuItem :
public
MenuItem
{
73
protected
:
74
menuid_t id;
75
uint8_t itemPosition;
76
uint8_t noOfParts;
77
public
:
78
RuntimeMenuItem(
MenuType
menuType, menuid_t
id
,
RuntimeRenderingFn
renderFn,
79
uint8_t itemPosition, uint8_t numberOfRows,
MenuItem
* next =
nullptr
);
80
81
RuntimeMenuItem(
const
AnyMenuInfo
* rtInfo,
bool
isPgm,
MenuType
menuType,
RuntimeRenderingFn
renderFn,
82
uint8_t itemPosition, uint8_t numberOfRows,
MenuItem
* next =
nullptr
);
83
84
void
copyValue(
char
* buffer,
int
bufferSize)
const
{
85
renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_VALUE
, buffer, bufferSize);
86
}
87
88
void
runCallback()
const
{ renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_INVOKE
,
nullptr
, 0); }
89
[[nodiscard]]
int
getRuntimeId()
const
{
return
int(
id
); }
90
[[nodiscard]]
int
getRuntimeEeprom()
const
{
return
renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_EEPROM_POS
,
nullptr
, 0); }
91
[[nodiscard]] uint8_t getNumberOfParts()
const
{
return
noOfParts; }
92
void
copyRuntimeName(
char
* buffer,
int
bufferSize)
const
{ renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_NAME
, buffer, bufferSize);}
93
94
[[nodiscard]] uint8_t getNumberOfRows()
const
{
return
noOfParts; }
95
[[nodiscard]] uint8_t getItemPosition()
const
{
return
itemPosition; }
96
97
void
setNumberOfRows(uint8_t rows) {
98
noOfParts = rows;
99
setChanged
(
true
);
100
setSendRemoteNeededAll
();
101
}
102
};
103
113
class
BackMenuItem
:
public
RuntimeMenuItem {
114
private
:
115
const
char
* namePtr;
116
public
:
123
BackMenuItem
(
RuntimeRenderingFn
renderFn,
MenuItem
* next)
124
: RuntimeMenuItem(
MENUTYPE_BACK_VALUE
,
nextRandomId
(), renderFn, 0, 1, next), namePtr(nullptr) { }
125
134
BackMenuItem
(
const
SubMenuInfo
*
info
,
MenuItem
* next,
bool
infoInPgm);
135
139
[[nodiscard]]
const
char
*
getNameUnsafe
()
const
{
return
namePtr; }
140
};
141
146
class
SubMenuItem
:
public
RuntimeMenuItem {
147
private
:
148
MenuItem
* child;
149
public
:
159
SubMenuItem
(
const
SubMenuInfo
*
info
,
MenuItem
* child,
MenuItem
* next =
nullptr
,
bool
infoInPgm = INFO_LOCATION_PGM)
160
: RuntimeMenuItem(
info
, infoInPgm,
MENUTYPE_SUB_VALUE
,
backSubItemRenderFn
, 0, 1, next) {
161
this->child = child;
162
}
163
171
SubMenuItem
(menuid_t
id
,
RuntimeRenderingFn
renderFn,
MenuItem
* child,
MenuItem
* next =
nullptr
)
172
: RuntimeMenuItem(
MENUTYPE_SUB_VALUE
, id, renderFn,
173
0, 1, next) {
174
this->child = child;
175
}
176
180
[[nodiscard]]
MenuItem
*
getChild
()
const
{
return
child; }
181
void
setChild(
MenuItem
* firstChildItem) { this->child = firstChildItem; }
182
};
183
184
#define LIST_PARENT_ITEM_POS 0xff
185
195
class
ListRuntimeMenuItem :
public
RuntimeMenuItem {
196
public
:
197
enum
ListMode: uint8_t { CUSTOM_RENDER, RAM_ARRAY, FLASH_ARRAY };
198
private
:
199
const
char
*
const
* dataArray;
200
uint8_t activeItem;
201
ListMode listMode = CUSTOM_RENDER;
202
public
:
203
ListRuntimeMenuItem(
const
AnyMenuInfo
*
info
,
int
numberOfRows,
const
char
*
const
* array, ListMode listMode,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
204
ListRuntimeMenuItem(
const
AnyMenuInfo
*
info
,
int
numberOfRows,
RuntimeRenderingFn
renderFn,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
205
ListRuntimeMenuItem(menuid_t
id
,
int
numberOfRows,
RuntimeRenderingFn
renderFn,
MenuItem
* next =
nullptr
);
206
207
RuntimeMenuItem* getChildItem(
int
pos);
208
RuntimeMenuItem* asParent();
209
RuntimeMenuItem* asBackMenu();
210
211
[[nodiscard]] ListMode getListMode()
const
{
return
listMode;}
212
[[nodiscard]]
bool
isActingAsParent()
const
{
return
itemPosition == LIST_PARENT_ITEM_POS; }
213
[[nodiscard]] uint8_t getActiveIndex()
const
{
return
activeItem; }
214
void
setActiveIndex(uint8_t idx) {
215
activeItem = idx;
216
setChanged
(
true
);
217
}
218
const
char
*
const
* getDataArray() {
return
dataArray; }
219
};
220
221
int
defaultRtListCallback(
RuntimeMenuItem
* item, uint8_t row,
RenderFnMode
mode,
char
* buffer,
int
bufferSize);
222
227
class
EditableMultiPartMenuItem :
public
RuntimeMenuItem {
228
public
:
229
EditableMultiPartMenuItem(
MenuType
type, menuid_t
id
,
int
numberOfParts,
RuntimeRenderingFn
renderFn,
MenuItem
* next =
nullptr
)
230
: RuntimeMenuItem(type,
id
, renderFn, 0, numberOfParts, next) {
231
}
232
EditableMultiPartMenuItem(
const
AnyMenuInfo
* rtInfo,
bool
isPgm,
MenuType
type,
int
numberOfParts,
RuntimeRenderingFn
renderFn,
MenuItem
* next =
nullptr
)
233
: RuntimeMenuItem(rtInfo, isPgm, type, renderFn, 0, numberOfParts, next) {
234
}
235
236
uint8_t beginMultiEdit();
237
238
int
changeEditBy(
int
amt);
239
240
int
previousPart();
241
242
int
nextPart();
243
244
[[nodiscard]]
int
getCurrentRange()
const
{
245
return
renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_GETRANGE
,
nullptr
, 0);
246
}
247
248
void
stopMultiEdit();
249
250
[[nodiscard]]
int
getPartValueAsInt()
const
{
251
return
renderFn((RuntimeMenuItem*)
this
, itemPosition,
RENDERFN_GETPART
,
nullptr
, 0);
252
}
253
254
bool
valueChanged(
int
newVal);
255
};
256
257
// number of characters in the edit set.
258
#define ALLOWABLE_CHARS_ENCODER_SIZE 94
259
265
class
TextMenuItem
:
public
EditableMultiPartMenuItem {
266
private
:
267
char
* data;
268
bool
passwordField;
269
public
:
278
TextMenuItem
(
RuntimeRenderingFn
customRenderFn, menuid_t
id
,
int
size,
MenuItem
* next =
nullptr
);
288
TextMenuItem
(
RuntimeRenderingFn
customRenderFn,
const
char
* initial, menuid_t
id
,
int
size,
MenuItem
* next =
nullptr
);
297
TextMenuItem
(
const
AnyMenuInfo
*
info
,
const
char
* initial,
int
size,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
298
308
TextMenuItem
(
const
AnyMenuInfo
*
info
,
RuntimeRenderingFn
customRenderFn,
const
char
* initial,
int
size,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
309
310
void
setPasswordField(
bool
pwd) {
311
this->passwordField = pwd;
312
}
313
317
[[nodiscard]]
bool
isPasswordField
()
const
{
318
return
this->passwordField;
319
}
320
321
~TextMenuItem
() {
delete
[] data; }
322
324
[[nodiscard]] uint8_t
textLength
()
const
{
return
noOfParts; }
325
331
void
setTextValue
(
const
char
* text,
bool
silent =
false
);
332
334
[[nodiscard]]
const
char
*
getTextValue
()
const
{
return
data; }
335
340
void
cleanUpArray
();
341
349
bool
setCharValue
(uint8_t location,
char
val);
350
358
bool
valueChangedFromKeyboard
(
char
keyPress);
359
private
:
360
void
initTextItem(
const
char
* initialData);
361
};
362
368
int
findPositionInEditorSet
(
char
ch);
369
374
class
IpAddressStorage {
375
private
:
376
uint8_t data[4];
377
public
:
378
explicit
IpAddressStorage(
const
char
* address);
379
IpAddressStorage(uint8_t p1, uint8_t p2, uint8_t p3, uint8_t p4);
380
IpAddressStorage(
const
IpAddressStorage& other) =
default
;
381
IpAddressStorage& operator=(
const
IpAddressStorage& other) =
default
;
382
383
void
setPart(
int
part, uint8_t newValue) { data[part] = newValue; }
384
uint8_t* underlyingArray() {
return
data; }
385
};
386
392
class
IpAddressMenuItem
:
public
EditableMultiPartMenuItem {
393
private
:
394
IpAddressStorage
data;
395
public
:
402
IpAddressMenuItem
(
RuntimeRenderingFn
renderFn, menuid_t
id
,
MenuItem
* next =
nullptr
)
403
: EditableMultiPartMenuItem(
MENUTYPE_IPADDRESS
, id, 4, renderFn, next), data(127, 0, 0, 1) {}
404
412
IpAddressMenuItem
(
RuntimeRenderingFn
renderFn,
const
IpAddressStorage
& initialIp, menuid_t
id
,
MenuItem
* next =
nullptr
)
413
: EditableMultiPartMenuItem(
MENUTYPE_IPADDRESS
, id, 4, renderFn, next), data(initialIp) {}
414
423
IpAddressMenuItem
(
const
AnyMenuInfo
*
info
,
RuntimeRenderingFn
renderFn,
const
IpAddressStorage
& initialIp,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM)
424
: EditableMultiPartMenuItem(
info
, isPgm,
MENUTYPE_IPADDRESS
, 4, renderFn, next), data(initialIp) {}
425
433
IpAddressMenuItem
(
const
AnyMenuInfo
*
info
,
const
IpAddressStorage
& initialIp,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM)
434
: EditableMultiPartMenuItem(
info
, isPgm,
MENUTYPE_IPADDRESS
, 4,
ipAddressRenderFn
, next), data(initialIp) {}
435
436
void
setIpAddress(
const
char
* source);
437
439
void
setIpAddress
(uint8_t p1, uint8_t p2, uint8_t p3, uint8_t p4) {
440
data =
IpAddressStorage
(p1, p2, p3, p4);
441
}
442
444
uint8_t*
getIpAddress
() {
return
data.underlyingArray(); }
445
446
void
setUnderlying(
const
IpAddressStorage
& other);
447
448
IpAddressStorage
& getUnderlying() {
return
data; }
449
451
void
setIpPart
(uint8_t part, uint8_t newVal);
452
};
453
458
struct
TimeStorage {
459
TimeStorage() {
460
this->hours = this->minutes = this->seconds = this->hundreds = 0;
461
}
462
TimeStorage(uint8_t hours, uint8_t minutes, uint8_t seconds = 0, uint8_t hundreds = 0) {
463
this->hours = hours;
464
this->minutes = minutes;
465
this->seconds = seconds;
466
this->hundreds = hundreds;
467
}
468
TimeStorage(
const
TimeStorage& other) =
default
;
469
TimeStorage& operator=(
const
TimeStorage& other) =
default
;
470
471
uint8_t hours;
472
uint8_t minutes;
473
uint8_t seconds;
474
uint8_t hundreds;
475
};
476
480
struct
DateStorage {
481
uint8_t day;
482
uint8_t month;
483
uint16_t year;
484
485
DateStorage() {
486
year = day = month = 0;
487
}
488
489
DateStorage(
int
day,
int
month,
int
year) {
490
this->day = day;
491
this->month = month;
492
this->year = year;
493
}
494
495
DateStorage(
const
DateStorage& other) =
default
;
496
DateStorage& operator=(
const
DateStorage& other)=
default
;
497
};
498
505
class
TimeFormattedMenuItem :
public
EditableMultiPartMenuItem {
506
private
:
507
MultiEditWireType
format;
508
TimeStorage
data;
509
public
:
510
TimeFormattedMenuItem(
RuntimeRenderingFn
renderFn, menuid_t
id
,
MultiEditWireType
format,
MenuItem
* next =
nullptr
);
511
TimeFormattedMenuItem(
RuntimeRenderingFn
renderFn,
const
TimeStorage
& initial, menuid_t
id
,
MultiEditWireType
format,
MenuItem
* next =
nullptr
);
512
TimeFormattedMenuItem(
const
AnyMenuInfo
*
info
,
RuntimeRenderingFn
renderFn,
const
TimeStorage
& initial,
MultiEditWireType
format,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
513
TimeFormattedMenuItem(
const
AnyMenuInfo
*
info
,
const
TimeStorage
& initial,
MultiEditWireType
format,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM);
514
516
[[nodiscard]]
TimeStorage
getTime
()
const
{
return
data; }
517
519
void
setTime
(
TimeStorage
newTime) { data = newTime; }
520
522
void
setTimeFromString
(
const
char
* time);
523
525
[[nodiscard]]
MultiEditWireType
getFormat
()
const
{
return
format; }
526
527
TimeStorage
* getUnderlyingData() {
return
&data;}
528
};
529
535
class
DateFormattedMenuItem :
public
EditableMultiPartMenuItem {
536
public
:
537
enum
DateFormatOption { DD_MM_YYYY, MM_DD_YYYY, YYYY_MM_DD };
538
private
:
539
DateStorage
data;
540
static
char
separator;
541
static
DateFormatOption dateFormatMode;
542
public
:
543
DateFormattedMenuItem(
RuntimeRenderingFn
renderFn, menuid_t
id
,
MenuItem
* next =
nullptr
)
544
: EditableMultiPartMenuItem(
MENUTYPE_DATE
,
id
, 3, renderFn, next), data(1, 1, 2020) {}
545
546
DateFormattedMenuItem(
RuntimeRenderingFn
renderFn,
const
DateStorage
& initial, menuid_t
id
,
MenuItem
* next =
nullptr
)
547
: EditableMultiPartMenuItem(
MENUTYPE_DATE
,
id
, 3, renderFn, next), data(initial) {}
548
549
DateFormattedMenuItem(
const
AnyMenuInfo
*
info
,
RuntimeRenderingFn
renderFn,
const
DateStorage
& initial, menuid_t
/*id*/
,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM)
550
: EditableMultiPartMenuItem(
info
, isPgm,
MENUTYPE_DATE
, 3, renderFn, next), data(initial) {}
551
552
DateFormattedMenuItem(
const
AnyMenuInfo
*
info
,
const
DateStorage
& initial,
MenuItem
* next =
nullptr
,
bool
isPgm = INFO_LOCATION_PGM)
553
: EditableMultiPartMenuItem(
info
, isPgm,
MENUTYPE_DATE
, 3,
dateItemRenderFn
, next), data(initial) {}
554
559
static
void
setDateSeparator
(
char
sep) {
560
separator = sep;
561
}
562
566
static
char
getDateSeparator
() {
567
return
separator;
568
}
569
574
static
void
setDateFormatStyle
(DateFormatOption fmt) {
575
dateFormatMode = fmt;
576
}
577
581
static
DateFormatOption
getDateFormatStyle
() {
582
return
dateFormatMode;
583
}
584
585
[[nodiscard]]
DateStorage
getDate()
const
{
return
data; }
586
587
void
setDate(DateStorage newDate) { data = newDate; }
588
589
void
setDateFromString(
const
char
*dateText);
590
591
DateStorage* getUnderlyingData() {
return
&data; }
592
};
593
600
long
parseIntUntilSeparator
(
const
char
* ptr,
int
& offset,
size_t
maxDigits=10);
601
607
inline
void
invokeIfSafe
(
MenuCallbackFn
cb,
MenuItem
* pItem) {
if
(cb && pItem) cb(pItem->
getId
()); }
608
619
#define RENDERING_CALLBACK_NAME_INVOKE(fnName, parent, namepgm, eepromPosition, invoke) \
620
const char fnName##Pgm[] PROGMEM = namepgm; \
621
int fnName(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int buffSize) { \
622
switch(mode) { \
623
case RENDERFN_NAME: \
624
safeProgCpy(buffer, fnName##Pgm, buffSize); \
625
return true; \
626
case RENDERFN_INVOKE: \
627
invokeIfSafe(invoke, item); \
628
return true; \
629
case RENDERFN_EEPROM_POS: \
630
return eepromPosition; \
631
default: \
632
return parent(item, row, mode, buffer, buffSize); \
633
} \
634
}
635
646
#define RENDERING_CALLBACK_NAME_OVERRIDDEN(fnName, customFn, namepgm, eepromPosition) \
647
const char fnName##Pgm[] PROGMEM = namepgm; \
648
int fnName(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int buffSize) { \
649
switch(mode) { \
650
case RENDERFN_NAME: \
651
if(customFn(item, row, mode, buffer, buffSize) == false) { \
652
safeProgCpy(buffer, fnName##Pgm, buffSize); \
653
} \
654
return true; \
655
case RENDERFN_EEPROM_POS: \
656
return eepromPosition; \
657
default: \
658
return customFn(item, row, mode, buffer, buffSize); \
659
} \
660
}
661
662
#endif
//_RUNTIME_MENUITEM_H_
MenuItems.h
In TcMenu, MenuItem storage is shared between program memory and RAM. Usually each MenuItem has assoc...
SubMenuInfo
AnyMenuInfo SubMenuInfo
Definition
MenuItems.h:176
RenderFnMode
RenderFnMode
Definition
MenuItems.h:292
RENDERFN_EEPROM_POS
@ RENDERFN_EEPROM_POS
Definition
MenuItems.h:298
RENDERFN_INVOKE
@ RENDERFN_INVOKE
Definition
MenuItems.h:300
RENDERFN_NAME
@ RENDERFN_NAME
Definition
MenuItems.h:296
RENDERFN_GETRANGE
@ RENDERFN_GETRANGE
Definition
MenuItems.h:306
RENDERFN_GETPART
@ RENDERFN_GETPART
Definition
MenuItems.h:308
RENDERFN_VALUE
@ RENDERFN_VALUE
Definition
MenuItems.h:294
RuntimeRenderingFn
int(* RuntimeRenderingFn)(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
MenuItems.h:327
MenuCallbackFn
void(* MenuCallbackFn)(int id)
Definition
MenuItems.h:45
MenuType
MenuType
Definition
MenuItems.h:247
MENUTYPE_IPADDRESS
@ MENUTYPE_IPADDRESS
Definition
MenuItems.h:278
MENUTYPE_DATE
@ MENUTYPE_DATE
Definition
MenuItems.h:282
MENUTYPE_SUB_VALUE
@ MENUTYPE_SUB_VALUE
Definition
MenuItems.h:269
MENUTYPE_BACK_VALUE
@ MENUTYPE_BACK_VALUE
Definition
MenuItems.h:263
AnyMenuInfo
Definition
MenuItems.h:51
ipAddressRenderFn
int ipAddressRenderFn(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
RuntimeMenuItem.cpp:157
dateItemRenderFn
int dateItemRenderFn(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
RuntimeMenuItem.cpp:300
invokeIfSafe
void invokeIfSafe(MenuCallbackFn cb, MenuItem *pItem)
Definition
RuntimeMenuItem.h:607
findPositionInEditorSet
int findPositionInEditorSet(char ch)
Definition
RuntimeMenuItem.cpp:372
nextRandomId
menuid_t nextRandomId()
Definition
RuntimeMenuItem.cpp:15
MultiEditWireType
MultiEditWireType
Definition
RuntimeMenuItem.h:43
EDITMODE_TIME_24H
@ EDITMODE_TIME_24H
Definition
RuntimeMenuItem.h:49
EDITMODE_TIME_DURATION_HUNDREDS
@ EDITMODE_TIME_DURATION_HUNDREDS
Definition
RuntimeMenuItem.h:59
EDITMODE_PLAIN_TEXT
@ EDITMODE_PLAIN_TEXT
Definition
RuntimeMenuItem.h:45
EDITMODE_TIME_12H_HHMM
@ EDITMODE_TIME_12H_HHMM
Definition
RuntimeMenuItem.h:63
EDITMODE_TIME_12H
@ EDITMODE_TIME_12H
Definition
RuntimeMenuItem.h:51
EDITMODE_IP_ADDRESS
@ EDITMODE_IP_ADDRESS
Definition
RuntimeMenuItem.h:47
EDITMODE_TIME_HUNDREDS_24H
@ EDITMODE_TIME_HUNDREDS_24H
Definition
RuntimeMenuItem.h:53
EDITMODE_GREGORIAN_DATE
@ EDITMODE_GREGORIAN_DATE
Definition
RuntimeMenuItem.h:55
EDITMODE_TIME_DURATION_SECONDS
@ EDITMODE_TIME_DURATION_SECONDS
Definition
RuntimeMenuItem.h:57
EDITMODE_TIME_24H_HHMM
@ EDITMODE_TIME_24H_HHMM
Definition
RuntimeMenuItem.h:61
timeItemRenderFn
int timeItemRenderFn(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
RuntimeMenuItem.cpp:197
parseIntUntilSeparator
long parseIntUntilSeparator(const char *ptr, int &offset, size_t maxDigits=10)
Definition
RuntimeMenuItem.cpp:511
textItemRenderFn
int textItemRenderFn(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
RuntimeMenuItem.cpp:383
backSubItemRenderFn
int backSubItemRenderFn(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition
RuntimeMenuItem.cpp:344
BackMenuItem::getNameUnsafe
const char * getNameUnsafe() const
Definition
RuntimeMenuItem.h:139
BackMenuItem::BackMenuItem
BackMenuItem(RuntimeRenderingFn renderFn, MenuItem *next)
Definition
RuntimeMenuItem.h:123
DateFormattedMenuItem::setDateSeparator
static void setDateSeparator(char sep)
Definition
RuntimeMenuItem.h:559
DateFormattedMenuItem::getDateFormatStyle
static DateFormatOption getDateFormatStyle()
Definition
RuntimeMenuItem.h:581
DateFormattedMenuItem::getDateSeparator
static char getDateSeparator()
Definition
RuntimeMenuItem.h:566
DateFormattedMenuItem::setDateFormatStyle
static void setDateFormatStyle(DateFormatOption fmt)
Definition
RuntimeMenuItem.h:574
IpAddressMenuItem::setIpPart
void setIpPart(uint8_t part, uint8_t newVal)
Definition
RuntimeMenuItem.cpp:495
IpAddressMenuItem::IpAddressMenuItem
IpAddressMenuItem(RuntimeRenderingFn renderFn, const IpAddressStorage &initialIp, menuid_t id, MenuItem *next=nullptr)
Definition
RuntimeMenuItem.h:412
IpAddressMenuItem::IpAddressMenuItem
IpAddressMenuItem(const AnyMenuInfo *info, const IpAddressStorage &initialIp, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
Definition
RuntimeMenuItem.h:433
IpAddressMenuItem::IpAddressMenuItem
IpAddressMenuItem(const AnyMenuInfo *info, RuntimeRenderingFn renderFn, const IpAddressStorage &initialIp, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
Definition
RuntimeMenuItem.h:423
IpAddressMenuItem::setIpAddress
void setIpAddress(uint8_t p1, uint8_t p2, uint8_t p3, uint8_t p4)
Definition
RuntimeMenuItem.h:439
IpAddressMenuItem::IpAddressMenuItem
IpAddressMenuItem(RuntimeRenderingFn renderFn, menuid_t id, MenuItem *next=nullptr)
Definition
RuntimeMenuItem.h:402
IpAddressMenuItem::getIpAddress
uint8_t * getIpAddress()
Definition
RuntimeMenuItem.h:444
IpAddressStorage
Definition
RuntimeMenuItem.h:374
MenuItem
Definition
MenuItems.h:338
MenuItem::setChanged
void setChanged(bool changed)
Definition
MenuItems.cpp:112
MenuItem::getId
menuid_t getId() const
Definition
MenuItems.cpp:81
MenuItem::MenuItem
MenuItem(const MenuItem &)=delete
MenuItem::info
const AnyMenuInfo * info
Definition
MenuItems.h:343
MenuItem::setSendRemoteNeededAll
void setSendRemoteNeededAll()
Definition
MenuItems.cpp:30
RuntimeMenuItem
Definition
RuntimeMenuItem.h:72
SubMenuItem::SubMenuItem
SubMenuItem(const SubMenuInfo *info, MenuItem *child, MenuItem *next=nullptr, bool infoInPgm=INFO_LOCATION_PGM)
Definition
RuntimeMenuItem.h:159
SubMenuItem::SubMenuItem
SubMenuItem(menuid_t id, RuntimeRenderingFn renderFn, MenuItem *child, MenuItem *next=nullptr)
Definition
RuntimeMenuItem.h:171
SubMenuItem::getChild
MenuItem * getChild() const
Definition
RuntimeMenuItem.h:180
TextMenuItem
Definition
RuntimeMenuItem.h:265
TextMenuItem::cleanUpArray
void cleanUpArray()
Definition
RuntimeMenuItem.cpp:123
TextMenuItem::textLength
uint8_t textLength() const
Definition
RuntimeMenuItem.h:324
TextMenuItem::getTextValue
const char * getTextValue() const
Definition
RuntimeMenuItem.h:334
TextMenuItem::valueChangedFromKeyboard
bool valueChangedFromKeyboard(char keyPress)
Definition
RuntimeMenuItem.cpp:614
TextMenuItem::setCharValue
bool setCharValue(uint8_t location, char val)
Definition
RuntimeMenuItem.cpp:133
TextMenuItem::TextMenuItem
TextMenuItem(RuntimeRenderingFn customRenderFn, menuid_t id, int size, MenuItem *next=nullptr)
Definition
RuntimeMenuItem.cpp:444
TextMenuItem::setTextValue
void setTextValue(const char *text, bool silent=false)
Definition
RuntimeMenuItem.cpp:112
TextMenuItem::isPasswordField
bool isPasswordField() const
Definition
RuntimeMenuItem.h:317
TimeFormattedMenuItem::getFormat
MultiEditWireType getFormat() const
Definition
RuntimeMenuItem.h:525
TimeFormattedMenuItem::getTime
TimeStorage getTime() const
Definition
RuntimeMenuItem.h:516
TimeFormattedMenuItem::setTime
void setTime(TimeStorage newTime)
Definition
RuntimeMenuItem.h:519
TimeFormattedMenuItem::setTimeFromString
void setTimeFromString(const char *time)
Definition
RuntimeMenuItem.cpp:527
DateStorage
Definition
RuntimeMenuItem.h:480
TimeStorage
Definition
RuntimeMenuItem.h:458
tcUtil.h
A series of utilities that used throughout tcMenu.