Fixed LCR scan and alt format, console widget, text input autotrim

This commit is contained in:
furrtek 2016-07-29 04:52:51 +02:00
parent 97435147fb
commit c58039e557
22 changed files with 221 additions and 277 deletions

View file

@ -173,13 +173,16 @@ class Rectangle : public Widget {
public:
Rectangle(Color c);
Rectangle(Rect parent_rect, Color c);
Rectangle();
void paint(Painter& painter) override;
void set_color(const Color c);
void set_outline(const bool outline);
private:
Color color;
bool _outline = false;
};
class Text : public Widget {
@ -225,6 +228,27 @@ private:
uint16_t _max = 100;
};
class Console : public Widget {
public:
Console(Rect parent_rect);
void clear();
void write(std::string message);
void writeln(std::string message);
void paint(Painter& painter) override;
void on_show() override;
void on_hide() override;
private:
bool visible = false;
Point pos { 0, 0 };
std::string buffer;
void crlf();
};
class Checkbox : public Widget {
public:
std::function<void(Checkbox&)> on_select;