15 #ifndef EMP_WEB_TEXT_H 16 #define EMP_WEB_TEXT_H 18 #include "../tools/DynamicString.h" 42 std::string
TypeName()
const override {
return "TextInfo"; }
43 virtual bool IsTextInfo()
const override {
return true; }
49 Widget Append(
const std::function<std::string()> & in_fun)
override;
52 virtual void GetHTML(std::stringstream & HTML)
override {
54 HTML <<
"<span id=\'" <<
id <<
"'>" 60 virtual std::string
GetType()
override {
return "web::TextInfo"; }
A Text widget handles putting text on a web page that can be controlled and modified.
Definition: Text.h:27
DynamicString & Clear()
Remove all contents on this DynamicString.
Definition: DynamicString.h:46
DynamicString & Append(const value_t &in_fun)
Add a new function to the end of the DynamicString.
Definition: DynamicString.h:67
TextInfo(const std::string &in_id="")
Definition: Text.h:37
bool AppendOK() const override
Definition: Text.h:45
std::string TypeName() const override
Debugging helpers...
Definition: Text.h:42
virtual bool IsTextInfo() const override
Definition: Text.h:43
Text & Clear()
Erase current text.
Definition: Text.h:81
~Text()
Definition: Text.h:76
Text(const Text &in)
Definition: Text.h:74
Text(const std::string &in_id="")
Definition: Text.h:70
void PreventAppend() override
Definition: Text.h:46
TextInfo & operator=(const TextInfo &)=delete
Widget Append(const std::string &in_text) override
Add new text to this string.
Definition: Text.h:85
virtual ~TextInfo()
Definition: Text.h:40
const TextInfo * Info() const
Definition: Text.h:66
DynamicString strings
All string (and functions returning strings) in Text widget.
Definition: Text.h:34
virtual void GetHTML(std::stringstream &HTML) override
Definition: Text.h:52
TextInfo * Info()
Definition: Text.h:65
If we are in emscripten, make sure to include the header.
Definition: array.h:37
virtual std::string GetType() override
Definition: Text.h:60
#define emp_assert(...)
Definition: assert.h:199
Definition: DynamicString.h:24
bool append_ok
Can this Text widget be extended?
Definition: Text.h:35
Text(TextInfo *in_info)
Definition: Text.h:68
Text(const Widget &in)
Definition: Text.h:75