Example #1
0
        public override void OnPaint(IGUIContext ctx, RectangleF bounds)
        {
            base.OnPaint(ctx, bounds);
            bounds.Inflate(-TextMargin.Width, -TextMargin.Height);

            if (!String.IsNullOrEmpty(Text))
            {
                ctx.DrawSelectedString(DisplayText, Font, SelStart, SelLength, bounds, TextOffsetX, Format,
                                       Style.ForeColorBrush.Color, Theme.Colors.HighLightBlue, Theme.Colors.White);
            }

            if (CursorOn && CursorVisible)
            {
                Style.ForeColorPen.Width = CursorLineWidth;
                float cp = Math.Max(3f, CursorPosPix + bounds.Left);
                ctx.DrawLine(Style.ForeColorPen, cp, bounds.Top + 1f, cp, bounds.Bottom - 2f);
            }
        }