-
Notifications
You must be signed in to change notification settings - Fork 24
/
GLCDButton.h
56 lines (43 loc) · 1.03 KB
/
GLCDButton.h
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
54
55
56
/*
Project: 1Sheeld Library
File: GLCDButton.h
Version: 7.0
Compiler: Arduino avr-gcc 4.3.2
Author: Integreight
Date: 2015.7
*/
#ifndef GLCDButton_h
#define GLCDButton_h
#define GLCD_BUTTON_TYPE 0x08
#define GLCD_BUTTON_TEXT 0x03
#define GLCD_BUTTON_DIMENSIONS 0x04
#define GLCD_BUTTON_STYLE 0x05
#define GLCD_BUTTON_VALUE 0x01
#define STYLE_2D 0x00
#define STYLE_3D 0x01
#include "ShapeClass.h"
class GLCDButton : public ShapeClass
{
friend class GLCDShield;
public:
GLCDButton(int , int , int ,int , const char * );
GLCDButton(int , int , int ,int);
bool isPressed();
void setText(const char *);
void setStyle(byte );
void setDimensions(int,int);
void setOnChange(void(*)(bool));
~GLCDButton();
private:
void draw();
int width;
int height;
int dataStringLength;
char * dataString;
bool dataMalloced;
bool value;
bool buttonHasName;
bool isCallBackAssigned;
void (*onChangeCallback)(bool);
};
#endif