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: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
button.h
- Committer:
- fzajdel
- Date:
- 2019-04-04
- Revision:
- 0:6d5a5f60d228
- Child:
- 2:bd49dd9c7bd6
File content as of revision 0:6d5a5f60d228:
#ifndef button_h
#define button_h
#include "mbed.h"
#include "rectangle.h"
#include "LCD_DISCO_F429ZI.h"
#include "config.h"
#include "widget.h"
#include "widgetcallback.h"
#include <string>
class Button : public Widget{
public:
Button(){}
Button(uint8_t x, uint8_t y, uint8_t width, uint8_t height, string Text = RECTANGLE_DEFAULT_TEXT);
Button(uint8_t x, uint8_t y, uint8_t width, uint8_t height, WidgetCallback* CbOnPress, WidgetCallback* CbOnRelease, string Text = RECTANGLE_DEFAULT_TEXT);
virtual ~Button(){};
virtual void Check(uint16_t X, uint16_t Y);
virtual Figure *GetFigure(); // Temporary Solution
private:
enum {PRESSED, RELEASED};
uint8_t State;
Rectangle* MyRectangle;
WidgetCallback* CbOnPress;
WidgetCallback* CbOnRelease;
void OnPress();
void OnRelease();
bool CheckRectRange(uint16_t x, uint16_t y);
};
#endif