Exemplo n.º 1
0
        public override RenderElement GetPrimaryRenderElement()
        {
            if (_myTextRun == null)
            {
                var t_run = new CustomTextRun(this.Width, this.Height);
                t_run.TextDrawingTech = _textDrawingTech;

                t_run.TextColor   = _textColor;
                t_run.BackColor   = _backColor;
                t_run.Text        = this.Text;
                t_run.PaddingLeft = this.PaddingLeft;
                t_run.PaddingTop  = this.PaddingTop;
                t_run.SetVisible(this.Visible);
                t_run.SetLocation(this.Left, this.Top);
                t_run.SetController(this);
                t_run.TransparentForMouseEvents = this.TransparentForMouseEvents;

                //
                if (_font != null)
                {
                    t_run.RequestFont = _font;
                }
                _myTextRun = t_run;
            }
            //-----------
            return(_myTextRun);
        }
Exemplo n.º 2
0
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (_myTextRun == null)
            {
                var trun = new CustomTextRun(rootgfx, this.Width, this.Height);

#if DEBUG
                trun.dbugBreak = this.dbugBreakOnRenderElement;
#endif
                trun.SetLocation(this.Left, this.Top);
                trun.TextColor   = _textColor;
                trun.Text        = this.Text;
                trun.PaddingLeft = this.PaddingLeft;
                trun.PaddingTop  = this.PaddingTop;
                trun.SetVisible(this.Visible);
                trun.SetController(this);
                //
                if (_font != null)
                {
                    trun.RequestFont = _font;
                }
                _myTextRun = trun;
            }
            //-----------
            return(_myTextRun);
        }