Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
This commit is contained in:
36
applications/lfrfid/view/elements/string_element.cpp
Normal file
36
applications/lfrfid/view/elements/string_element.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "string_element.h"
|
||||
#include <gui/elements.h>
|
||||
|
||||
StringElement::StringElement() {
|
||||
}
|
||||
|
||||
StringElement::~StringElement() {
|
||||
}
|
||||
|
||||
void StringElement::draw(Canvas* canvas) {
|
||||
if(text) {
|
||||
canvas_set_font(canvas, font);
|
||||
elements_multiline_text_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