many updates..

new sensors.. display.. led.. drawing.. stuff..
This commit is contained in:
kazu
2019-01-17 23:12:01 +01:00
parent 90e9fee101
commit 5cb02880b3
30 changed files with 5305 additions and 97 deletions

45
ext/lcd/ui/UILabel.h Normal file
View File

@@ -0,0 +1,45 @@
#ifndef UI_LABEL_H
#define UI_LABEL_H
#include "UIElement.h"
#include "UIStructs.h"
#undef min
#undef max
#include <string>
class UILabel : public UIElement {
std::string txt;
Color cBackground = Color::fromRGB(255,255,255);
Color cText = Color::fromRGB(0,0,0);
public:
UILabel() {
;
}
void setText(const std::string& txt) {
this->txt = txt;
setNeedsRedraw();
}
void draw(UIPainter& p) {
p.setFG(cBackground);
p.fillRect(rect);
//const uint16_t txtW = fnt_f1.getWidth(txt);
//const uint16_t txtH = fnt_f1.getHeight();
p.setFG(cText);
p.drawText(rect.x, rect.y, txt.c_str());
}
};
#endif // UI_LABEL_H