-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLCDMenuItem.cpp
More file actions
53 lines (44 loc) · 767 Bytes
/
LCDMenuItem.cpp
File metadata and controls
53 lines (44 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "LCDMenuItem.h"
//#include <stdio.h>
LCDMenuItem::LCDMenuItem(String newName)
{
setName(newName);
}
void LCDMenuItem::setName(String newName)
{
/* char buffer[16];
newName.toCharArray(buffer,16);
snprintf(buffer, 15, "%s ", buffer);
Name=String(buffer);
*/
Name = newName + " ";
Name = Name.substring(0,16);
}
String LCDMenuItem::getName()
{
return Name;
}
void LCDMenuItem::setNext(LCDMenuItem *item)
{
Next = item;
}
void LCDMenuItem::setPrev(LCDMenuItem *item)
{
Prev = item;
}
LCDMenuItem* LCDMenuItem::getNext()
{
return Next;
}
LCDMenuItem* LCDMenuItem::getPrev()
{
return Prev;
}
void LCDMenuItem::setAction(void (*newAction)())
{
action=newAction;
}
void LCDMenuItem::executeAction()
{
action();
}