Add more tags to Rich Text Box

This commit is contained in:
2022-08-03 12:57:22 +02:00
parent 64609f823c
commit ad37b8361b
9 changed files with 205 additions and 25 deletions
@@ -12,6 +12,11 @@ namespace FlaxEngine.GUI
/// </summary>
public struct ParsingContext
{
/// <summary>
/// Text box control.
/// </summary>
public RichTextBox Control;
/// <summary>
/// HTML tags parser.
/// </summary>
@@ -55,6 +60,10 @@ namespace FlaxEngine.GUI
{
{ "br", ProcessBr },
{ "color", ProcessColor },
{ "alpha", ProcessAlpha },
{ "style", ProcessStyle },
{ "b", ProcessBold },
{ "i", ProcessItalic },
};
private HtmlParser _parser = new HtmlParser();
@@ -75,6 +84,7 @@ namespace FlaxEngine.GUI
_styleStack.Push(_textStyle);
var context = new ParsingContext
{
Control = this,
Parser = _parser,
StyleStack = _styleStack,
};