Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG
Diff: button.h
- Revision:
- 0:8c1b74ecac29
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/button.h Thu Jun 25 16:51:20 2020 +0000 @@ -0,0 +1,27 @@ +#ifndef BUTTON_H +#define BUTTON_H +#include "stm32746g_discovery_lcd.h" +class Button +{ + +public: + Button(int x = 50, int y = 50, int width = 50, int height = 30, uint32_t bgColor = LCD_COLOR_LIGHTGRAY, uint32_t borderWidth = 1); + void setText(const char *str, uint32_t textColor = LCD_COLOR_BLACK); + bool contain(int x, int y); + void draw(); + int strlen(uint8_t *str); + bool etat(){return m_etat;} + +private : + bool m_etat = false; + int16_t m_x = 0; + int16_t m_y = 0; + int16_t m_width = 50; + int16_t m_height = 30; + uint32_t m_bgColor = LCD_COLOR_LIGHTGRAY; + uint32_t m_borderColor = LCD_COLOR_GRAY; + uint32_t m_textColor = LCD_COLOR_BLACK; + uint32_t m_borderWidth = 1; + uint8_t m_text[30]; +}; +#endif \ No newline at end of file