mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-10 15:40:29 -04:00
Fixed LCR scan and alt format, console widget, text input autotrim
This commit is contained in:
parent
97435147fb
commit
c58039e557
22 changed files with 221 additions and 277 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue