public TextFlowLabel(int w, int h) : base(w, h) { AcceptKeyboardFocus = true; _textSpanStyle = new TextSpanStyle(); _textSpanStyle.FontColor = Color.Black; //default, use theme }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (textEditRenderElement == null) { var tbox = new TextEditRenderBox(rootgfx, this.Width, this.Height, _multiline); tbox.SetLocation(this.Left, this.Top); tbox.HasSpecificSize = true; if (this.defaultSpanStyle.IsEmpty()) { this.defaultSpanStyle = new TextSpanStyle(); this.defaultSpanStyle.FontInfo = rootgfx.DefaultTextEditFontInfo; tbox.CurrentTextSpanStyle = this.defaultSpanStyle; } else { tbox.CurrentTextSpanStyle = this.defaultSpanStyle; } tbox.BackgroundColor = this.backgroundColor; tbox.SetController(this); if (this.textSurfaceListener != null) { tbox.TextSurfaceListener = textSurfaceListener; } this.textEditRenderElement = tbox; if (userTextContent != null) { this.Text = userTextContent; userTextContent = null;//clear } } return(textEditRenderElement); }
public DocActionFormatting(TextSpanStyle textStyle, int startLineNumber, int startCharIndex, int endLineNumber, int endCharIndex) : base(startLineNumber, startCharIndex) { _textStyle = textStyle; _endCharIndex = endCharIndex; EndLineNumber = endLineNumber; }
public TextSpan(string spanText, SourceExtent sourceExtent, ParserMode parserMode, TextSpanStyle spanStyle = TextSpanStyle.Normal) : base( parserMode == ParserMode.Full ? MarkdownParser.UnwindMarkdownCharsEscaping(spanText.Trim()) : spanText, sourceExtent) { this.Style = spanStyle; this.ParserMode = parserMode; }
public TextSpan(string spanText, SourceExtent sourceExtent, TextSpanStyle spanStyle = TextSpanStyle.Normal) : base(UnwindMarkdownCharsEscaping(spanText.Trim()), sourceExtent) { this.Style = spanStyle; }