示例#1
0
        public TextFlowLabel(int w, int h) : base(w, h)
        {
            AcceptKeyboardFocus = true;

            _textSpanStyle           = new TextSpanStyle();
            _textSpanStyle.FontColor = Color.Black; //default, use theme
        }
示例#2
0
        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);
        }
示例#3
0
 public DocActionFormatting(TextSpanStyle textStyle, int startLineNumber, int startCharIndex, int endLineNumber, int endCharIndex)
     : base(startLineNumber, startCharIndex)
 {
     _textStyle    = textStyle;
     _endCharIndex = endCharIndex;
     EndLineNumber = endLineNumber;
 }
示例#4
0
 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;
 }
示例#5
0
 public TextSpan(string spanText, SourceExtent sourceExtent, TextSpanStyle spanStyle = TextSpanStyle.Normal)
     : base(UnwindMarkdownCharsEscaping(spanText.Trim()), sourceExtent)
 {
     this.Style = spanStyle;
 }
示例#6
0
 public TextSpan(string spanText, SourceExtent sourceExtent, TextSpanStyle spanStyle = TextSpanStyle.Normal)
     : base(UnwindMarkdownCharsEscaping(spanText.Trim()), sourceExtent)
 {
     this.Style = spanStyle;
 }