48 void onChange(std::function<
void(
const std::string&)> cb);
70 void updateActiveState();
71 bool _autoHideToolbar =
false;
73 bool _prevMouseDown =
false;
74 void rehighlightCode();
75 void highlightCodeRange(std::size_t a, std::size_t b,
76 const std::string& text);
77 bool _inCodeHl =
false;
87 static constexpr unsigned int kMinFontSize = 6;
88 static constexpr unsigned int kMaxFontSize = 200;
89 static constexpr float kCompactBelow = 520.f;
91 std::size_t _iBold = 0, _iItalic = 0, _iUnderline = 0;
92 std::size_t _iAlignL = 0, _iAlignC = 0, _iAlignR = 0;
93 std::size_t _iListBullet = 0, _iListNum = 0;
94 std::size_t _iMenu = 0;
95 bool _b =
false, _i =
false, _u =
false;
96 bool _compact =
false;
97 bool _syncing =
false;
100 std::string _curStyle =
"Paragraph";
104 void applyToParagraph(
const std::function<
void()>& fn);
105 void setParagraphAlign(
int align);
106 void toggleList(
int listType);
108 void buildBar(
bool compact);
109 void openAlignListMenu();
112 void syncControlsToCursor();
116 std::size_t _colorSelStart = 0, _colorSelEnd = 0;
117 std::size_t _hdSelStart = 0, _hdSelEnd = 0;
119 std::function<void(
const std::string&)> _onChange;
void setRichText(const std::string &json)
void setVisible(bool visible) override
void setAutoHideToolbar(bool enabled)
When enabled, the formatting toolbar is hidden until the editor is "active" (the user clicks inside i...
void setSize(const sf::Vector2f &size)
std::string getValue() const
std::string getRichText() const
void setValue(const std::string &text)
void setPosition(const sf::Vector2f &pos) override
Move the panel and shift all children by the same delta.
void onChange(std::function< void(const std::string &)> cb)
A multi-line rich text input field with vertical scrolling.