Kerry Martin
/
Liz_Test_Code
KSM edits
Button.h@19:fee3f71fab2d, 2019-07-10 (annotated)
- Committer:
- lizard753
- Date:
- Wed Jul 10 13:30:27 2019 +0000
- Revision:
- 19:fee3f71fab2d
- Child:
- 20:d25fb9c55781
Adding button library and main code for button
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lizard753 | 19:fee3f71fab2d | 1 | |
lizard753 | 19:fee3f71fab2d | 2 | /// |
lizard753 | 19:fee3f71fab2d | 3 | /// |
lizard753 | 19:fee3f71fab2d | 4 | /// libraries used: |
lizard753 | 19:fee3f71fab2d | 5 | #include "RA8875.h" |
lizard753 | 19:fee3f71fab2d | 6 | #include "DisplayDefs.h" |
lizard753 | 19:fee3f71fab2d | 7 | #include <string> |
lizard753 | 19:fee3f71fab2d | 8 | |
lizard753 | 19:fee3f71fab2d | 9 | // set up global variables |
lizard753 | 19:fee3f71fab2d | 10 | // |
lizard753 | 19:fee3f71fab2d | 11 | |
lizard753 | 19:fee3f71fab2d | 12 | class Button |
lizard753 | 19:fee3f71fab2d | 13 | { |
lizard753 | 19:fee3f71fab2d | 14 | public: |
lizard753 | 19:fee3f71fab2d | 15 | //Button(); |
lizard753 | 19:fee3f71fab2d | 16 | Button(loc_t arg_corner1_x, loc_t arg_corner1_y, loc_t arg_corner2_x, loc_t arg_corner2_y, color_t arg_color, RA8875 *arg_display, const char * arg_name); |
lizard753 | 19:fee3f71fab2d | 17 | bool isPressed(loc_t cur_x, loc_t cur_y); |
lizard753 | 19:fee3f71fab2d | 18 | void draw(); |
lizard753 | 19:fee3f71fab2d | 19 | string toString(); |
lizard753 | 19:fee3f71fab2d | 20 | private: |
lizard753 | 19:fee3f71fab2d | 21 | const loc_t corner1_x, corner1_y, corner2_x, corner2_y; |
lizard753 | 19:fee3f71fab2d | 22 | char * button_name; |
lizard753 | 19:fee3f71fab2d | 23 | const color_t button_color; |
lizard753 | 19:fee3f71fab2d | 24 | RA8875 *lcd; |
lizard753 | 19:fee3f71fab2d | 25 | //string button_name; |
lizard753 | 19:fee3f71fab2d | 26 | }; |
lizard753 | 19:fee3f71fab2d | 27 | |
lizard753 | 19:fee3f71fab2d | 28 |