New LF-RFID app (#534)
* Hal lfrfid: add read timer pulse and period config fns * New debug application for lfrfid subsystem * New lfrfid: app, fix naming * App lfrfid: assets * Container view module * App ibutton: remove unused header * App lfrfid scenes * App notification, add yield to blocking operations, add speaker volume control * App lfrfid: reading key scene * Assets: placeholder icon * App lfrfid: reworked container view module * App lfrfid: new scenes * App lfrfid: write scene * App lfrfid: write hid * App lfrfid: emulate scene * App lfrfid: save name scene * App lfrfid: add missing file
This commit is contained in:
35
applications/lfrfid/view/elements/string-element.cpp
Normal file
35
applications/lfrfid/view/elements/string-element.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "string-element.h"
|
||||
|
||||
StringElement::StringElement() {
|
||||
}
|
||||
|
||||
StringElement::~StringElement() {
|
||||
}
|
||||
|
||||
void StringElement::draw(Canvas* canvas) {
|
||||
if(text) {
|
||||
canvas_set_font(canvas, font);
|
||||
canvas_draw_str_aligned(canvas, x, y, horizontal, vertical, text);
|
||||
}
|
||||
}
|
||||
|
||||
bool StringElement::input(InputEvent* event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void StringElement::set_text(
|
||||
const char* _text,
|
||||
uint8_t _x,
|
||||
uint8_t _y,
|
||||
Align _horizontal,
|
||||
Align _vertical,
|
||||
Font _font) {
|
||||
lock_model();
|
||||
text = _text;
|
||||
x = _x;
|
||||
y = _y;
|
||||
horizontal = _horizontal;
|
||||
vertical = _vertical;
|
||||
font = _font;
|
||||
unlock_model(true);
|
||||
}
|
Reference in New Issue
Block a user