Buttons changing color when tapped.
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
rectangle.h@2:bd49dd9c7bd6, 2019-05-19 (annotated)
- Committer:
- fzajdel
- Date:
- Sun May 19 11:59:32 2019 +0000
- Revision:
- 2:bd49dd9c7bd6
- Parent:
- 0:6d5a5f60d228
Touch screen with buttons
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fzajdel | 0:6d5a5f60d228 | 1 | #ifndef rect_h |
fzajdel | 0:6d5a5f60d228 | 2 | #define rect_h |
fzajdel | 0:6d5a5f60d228 | 3 | |
fzajdel | 0:6d5a5f60d228 | 4 | #include "mbed.h" |
fzajdel | 0:6d5a5f60d228 | 5 | #include "figure.h" |
fzajdel | 0:6d5a5f60d228 | 6 | #include "LCD_DISCO_F429ZI.h" |
fzajdel | 0:6d5a5f60d228 | 7 | #include "config.h" |
fzajdel | 0:6d5a5f60d228 | 8 | #include <string> |
fzajdel | 0:6d5a5f60d228 | 9 | |
fzajdel | 0:6d5a5f60d228 | 10 | using std::string; |
fzajdel | 0:6d5a5f60d228 | 11 | |
fzajdel | 0:6d5a5f60d228 | 12 | class Rectangle : public Figure { |
fzajdel | 0:6d5a5f60d228 | 13 | public: |
fzajdel | 0:6d5a5f60d228 | 14 | Rectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint32_t FillingColor = RECTANGLE_DEFAULT_FILLING_COLOR, uint32_t FrameColor = RECTANGLE_DEFAULT_FRAME_COLOR, |
fzajdel | 0:6d5a5f60d228 | 15 | string Text = RECTANGLE_DEFAULT_TEXT, uint32_t TextColor = RECTANGLE_DEFAULT_TEXT_COLOR); |
fzajdel | 0:6d5a5f60d228 | 16 | |
fzajdel | 0:6d5a5f60d228 | 17 | virtual LCD_DISCO_F429ZI & Draw(LCD_DISCO_F429ZI &); |
fzajdel | 0:6d5a5f60d228 | 18 | virtual void SetFillingColor(uint32_t Color); |
fzajdel | 0:6d5a5f60d228 | 19 | virtual void SetFrameColor(uint32_t Color); |
fzajdel | 0:6d5a5f60d228 | 20 | virtual void SetText(string RectangleText, uint32_t TextColor, uint32_t TextBackgroundColor); |
fzajdel | 0:6d5a5f60d228 | 21 | uint16_t GetX(); |
fzajdel | 0:6d5a5f60d228 | 22 | uint16_t GetY(); |
fzajdel | 0:6d5a5f60d228 | 23 | uint16_t GetWidth(); |
fzajdel | 0:6d5a5f60d228 | 24 | uint16_t GetHeight(); |
fzajdel | 0:6d5a5f60d228 | 25 | |
fzajdel | 0:6d5a5f60d228 | 26 | private: |
fzajdel | 0:6d5a5f60d228 | 27 | uint16_t x, y, width, height; |
fzajdel | 0:6d5a5f60d228 | 28 | uint32_t FillingColor, FrameColor, TextColor, TextBackColor; |
fzajdel | 0:6d5a5f60d228 | 29 | string Text; |
fzajdel | 0:6d5a5f60d228 | 30 | |
fzajdel | 0:6d5a5f60d228 | 31 | void DisplayString(LCD_DISCO_F429ZI &lcd); |
fzajdel | 0:6d5a5f60d228 | 32 | }; |
fzajdel | 0:6d5a5f60d228 | 33 | |
fzajdel | 0:6d5a5f60d228 | 34 | |
fzajdel | 0:6d5a5f60d228 | 35 | #endif |