unleashed-firmware/applications/lfrfid/view/elements/string-element.cpp
SG 22e1ecb642
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
2021-06-28 17:42:30 +03:00

35 lines
658 B
C++

#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);
}