Interfaçage NeoPixel Ring 12, LPRO MECSE, Arnaud A.
button.h@7:ca859a221807, 2020-06-17 (annotated)
- Committer:
- Rhamao
- Date:
- Wed Jun 17 16:33:20 2020 +0000
- Revision:
- 7:ca859a221807
- Parent:
- 5:c4038609e806
View 1 finie
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhamao | 0:eccd33c01946 | 1 | #ifndef BUTTON_H |
Rhamao | 0:eccd33c01946 | 2 | #define BUTTON_H |
Rhamao | 0:eccd33c01946 | 3 | #include "stm32746g_discovery_lcd.h" |
Rhamao | 7:ca859a221807 | 4 | |
Rhamao | 0:eccd33c01946 | 5 | class Button |
Rhamao | 0:eccd33c01946 | 6 | { |
Rhamao | 0:eccd33c01946 | 7 | |
Rhamao | 0:eccd33c01946 | 8 | public: |
Rhamao | 5:c4038609e806 | 9 | Button(int x = 50, int y = 50, int width = 50, int height = 30, uint32_t bgColor = LCD_COLOR_LIGHTGRAY, uint32_t borderColor=LCD_COLOR_GRAY, uint32_t borderWidth=1); |
Rhamao | 0:eccd33c01946 | 10 | void setText(const char *str, uint32_t textColor = LCD_COLOR_BLACK); |
Rhamao | 0:eccd33c01946 | 11 | bool contain(int x, int y); |
Rhamao | 0:eccd33c01946 | 12 | void draw(); |
Rhamao | 0:eccd33c01946 | 13 | int strlen(uint8_t *str); |
Rhamao | 0:eccd33c01946 | 14 | bool etat(){return m_etat;} |
Rhamao | 1:3ce68d55dfb8 | 15 | uint8_t* getText(); |
Rhamao | 2:fd11fb4d51f8 | 16 | void setBackgroundColor(uint32_t color); |
Rhamao | 4:b4c30f6f526e | 17 | void setBorderWidth(uint32_t borderWidth); |
Rhamao | 0:eccd33c01946 | 18 | |
Rhamao | 0:eccd33c01946 | 19 | private : |
Rhamao | 0:eccd33c01946 | 20 | bool m_etat = false; |
Rhamao | 0:eccd33c01946 | 21 | int16_t m_x = 0; |
Rhamao | 0:eccd33c01946 | 22 | int16_t m_y = 0; |
Rhamao | 0:eccd33c01946 | 23 | int16_t m_width = 50; |
Rhamao | 0:eccd33c01946 | 24 | int16_t m_height = 30; |
Rhamao | 0:eccd33c01946 | 25 | uint32_t m_bgColor = LCD_COLOR_LIGHTGRAY; |
Rhamao | 0:eccd33c01946 | 26 | uint32_t m_borderColor = LCD_COLOR_GRAY; |
Rhamao | 0:eccd33c01946 | 27 | uint32_t m_textColor = LCD_COLOR_BLACK; |
Rhamao | 0:eccd33c01946 | 28 | uint32_t m_borderWidth = 1; |
Rhamao | 0:eccd33c01946 | 29 | uint8_t m_text[30]; |
Rhamao | 0:eccd33c01946 | 30 | }; |
Rhamao | 0:eccd33c01946 | 31 | #endif |