2021-06-28 14:42:30 +00:00
|
|
|
#include "string-element.h"
|
2021-07-04 16:01:16 +00:00
|
|
|
#include <gui/elements.h>
|
2021-06-28 14:42:30 +00:00
|
|
|
|
|
|
|
StringElement::StringElement() {
|
|
|
|
}
|
|
|
|
|
|
|
|
StringElement::~StringElement() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void StringElement::draw(Canvas* canvas) {
|
|
|
|
if(text) {
|
|
|
|
canvas_set_font(canvas, font);
|
2021-07-04 16:01:16 +00:00
|
|
|
elements_multiline_text_aligned(canvas, x, y, horizontal, vertical, text);
|
2021-06-28 14:42:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|