Stephane Marques / Mbed OS DISCO-F746NG_LCDTS_demo

Dependencies:   BSP_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers button.h Source File

button.h

00001 #ifndef BUTTON_H
00002 #define BUTTON_H
00003 #include "stm32746g_discovery_lcd.h"
00004 class Button
00005 {
00006 
00007 public:
00008     Button(int x = 50, int y = 50, int width = 50, int height = 30, uint32_t bgColor = LCD_COLOR_LIGHTGRAY, uint32_t borderWidth = 1);
00009     void setText(const char *str, uint32_t textColor = LCD_COLOR_BLACK);
00010     bool contain(int x, int y);
00011     void draw();
00012     int strlen(uint8_t *str);
00013     bool etat(){return m_etat;}
00014     
00015 private :
00016     bool m_etat = false;
00017     int16_t m_x = 0;
00018     int16_t m_y = 0;
00019     int16_t m_width = 50;
00020     int16_t m_height = 30;
00021     uint32_t m_bgColor = LCD_COLOR_LIGHTGRAY;
00022     uint32_t m_borderColor = LCD_COLOR_GRAY;
00023     uint32_t m_textColor = LCD_COLOR_BLACK;
00024     uint32_t m_borderWidth = 1;
00025     uint8_t m_text[30];
00026 };
00027 #endif