Demo to control 4 LEDs
Dependencies: BSP_DISCO_F469NI mbed
Widgets/Textbox.h@2:e6fc24fbd86c, 2017-10-31 (annotated)
- Committer:
- Faberge
- Date:
- Tue Oct 31 14:46:28 2017 +0000
- Revision:
- 2:e6fc24fbd86c
- Parent:
- 1:a6d179a9ffbb
Update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Faberge | 0:e06404fdff2f | 1 | /* |
Faberge | 0:e06404fdff2f | 2 | * Textbox.h |
Faberge | 0:e06404fdff2f | 3 | * |
Faberge | 0:e06404fdff2f | 4 | * Copyright 2017 Faberge@TsarTeam |
Faberge | 0:e06404fdff2f | 5 | * |
Faberge | 0:e06404fdff2f | 6 | * This program is free software; you can redistribute it and/or modify |
Faberge | 0:e06404fdff2f | 7 | * it under the terms of the GNU General Public License as published by |
Faberge | 0:e06404fdff2f | 8 | * the Free Software Foundation; either version 2 of the License, or |
Faberge | 0:e06404fdff2f | 9 | * (at your option) any later version. |
Faberge | 0:e06404fdff2f | 10 | * |
Faberge | 0:e06404fdff2f | 11 | * This program is distributed in the hope that it will be useful, |
Faberge | 0:e06404fdff2f | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Faberge | 0:e06404fdff2f | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Faberge | 0:e06404fdff2f | 14 | * GNU General Public License for more details. |
Faberge | 0:e06404fdff2f | 15 | * |
Faberge | 0:e06404fdff2f | 16 | */ |
Faberge | 0:e06404fdff2f | 17 | |
Faberge | 0:e06404fdff2f | 18 | #ifndef TEXTBOX_H |
Faberge | 0:e06404fdff2f | 19 | #define TEXTBOX_H |
Faberge | 0:e06404fdff2f | 20 | |
Faberge | 0:e06404fdff2f | 21 | #include "Widget.h" |
Faberge | 0:e06404fdff2f | 22 | |
Faberge | 0:e06404fdff2f | 23 | class Textbox : public Widget |
Faberge | 0:e06404fdff2f | 24 | { |
Faberge | 0:e06404fdff2f | 25 | public: |
Faberge | 0:e06404fdff2f | 26 | static const uint16_t DIMX = 0; |
Faberge | 0:e06404fdff2f | 27 | static const uint16_t DIMY = 0; |
Faberge | 0:e06404fdff2f | 28 | |
Faberge | 1:a6d179a9ffbb | 29 | Textbox(const uint16_t x, const uint16_t y, const color_t clr, |
Faberge | 1:a6d179a9ffbb | 30 | char *s = "", text_mode_t tm = LEFT_MODE) : |
Faberge | 1:a6d179a9ffbb | 31 | Widget(x, y, DIMX, DIMY, clr), str(s), mode(tm) {draw(backColor);} |
Faberge | 0:e06404fdff2f | 32 | |
Faberge | 0:e06404fdff2f | 33 | virtual void draw(color_t clr); |
Faberge | 0:e06404fdff2f | 34 | virtual uint16_t update() {return 0;}; |
Faberge | 0:e06404fdff2f | 35 | |
Faberge | 0:e06404fdff2f | 36 | private: |
Faberge | 0:e06404fdff2f | 37 | char * str; |
Faberge | 1:a6d179a9ffbb | 38 | text_mode_t mode; |
Faberge | 0:e06404fdff2f | 39 | }; |
Faberge | 0:e06404fdff2f | 40 | |
Faberge | 0:e06404fdff2f | 41 | #endif |