Added utilities > Frequency manager + load/save

This commit is contained in:
furrtek
2016-12-26 01:31:38 +01:00
parent ad2a4b6743
commit 7df5987b3b
21 changed files with 526 additions and 219 deletions
+7 -3
View File
@@ -316,7 +316,7 @@ Text::Text(
Rect parent_rect,
std::string text
) : Widget { parent_rect },
text { text }
text_ { text }
{
}
@@ -327,10 +327,14 @@ Text::Text(
}
void Text::set(const std::string value) {
text = value;
text_ = value;
set_dirty();
}
std::string Text::text() const {
return text_;
}
void Text::paint(Painter& painter) {
const auto rect = screen_rect();
const auto s = style();
@@ -340,7 +344,7 @@ void Text::paint(Painter& painter) {
painter.draw_string(
rect.pos,
s,
text
text_
);
}
+4 -5
View File
@@ -104,6 +104,7 @@ public:
void set_style(const Style* new_style);
const Style& style() const;
uint16_t id = 0;
// State management methods.
void set_dirty();
@@ -115,8 +116,6 @@ public:
bool highlighted() const;
void set_highlighted(const bool value);
uint16_t id = 0;
protected:
void dirty_overlapping_children_in_rect(const Rect& child_rect);
@@ -192,18 +191,19 @@ private:
class Text : public Widget {
public:
Text(
) : text { "" } {
) : text_ { "" } {
}
Text(Rect parent_rect, std::string text);
Text(Rect parent_rect);
void set(const std::string value);
std::string text() const;
void paint(Painter& painter) override;
private:
std::string text;
std::string text_;
};
class BigFrequency : public Widget {
@@ -265,7 +265,6 @@ public:
}
void set_text(const std::string value);
// std::string text() const;
bool set_value(const bool value);
bool value() const;