-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathscreenitem.h
More file actions
36 lines (28 loc) · 1.02 KB
/
Copy pathscreenitem.h
File metadata and controls
36 lines (28 loc) · 1.02 KB
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
#if !defined(__SCREENITEM_H__)
#define __SCREENITEM_H__
#include <inttypes.h>
#include <Max_LCD.h>
#include "dataitem.h"
struct ScreenItemAttributes
{
uint16_t bmLeft : 4;
uint16_t bmTop : 2;
uint16_t bmLen : 5;
uint16_t bmHighlighted : 1;
uint16_t bmHlChanged : 1;
uint16_t bmPgmString : 1;
};
class ScreenItem
{
ScreenItemAttributes itemAttribs;
void *dataItem;
void Print(Max_LCD *p);
void SetAttribs(uint8_t left, uint8_t top, uint8_t len, bool highlighted, bool pgm);
public:
ScreenItem(uint8_t left, uint8_t top, uint8_t len, bool highlighted, DataItemBase *item);
ScreenItem(uint8_t left, uint8_t top, uint8_t len, bool highlighted, const char *item);
void Update(Max_LCD *pLcd, bool initial = true);
void Highlight(bool on) { itemAttribs.bmHighlighted = (on) ? 1 : 0; itemAttribs.bmHlChanged = 1; };
bool IsHighlighted() { return (itemAttribs.bmHighlighted == 1); };
};
#endif